Skip to content

Instantly share code, notes, and snippets.

@samueljmurray
Created August 30, 2017 15:56
Show Gist options
  • Save samueljmurray/5a495bc0bf2835e1f08eddd70a2e7a86 to your computer and use it in GitHub Desktop.
Save samueljmurray/5a495bc0bf2835e1f08eddd70a2e7a86 to your computer and use it in GitHub Desktop.
Button component - without function
/* Button.js */
import styles from "buttonStyles";
class Button extends React.Component {
render() {
return (
<View style={[
styles.button,
this.props.colour && {
backgroundColor: this.props.colour
},
this.props.disabled && styles.button_disabled,
]}>
// ...
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment