Skip to content

Instantly share code, notes, and snippets.

@skellock
Created June 27, 2016 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skellock/41d405e194c83ebe5c73eb6a32965b76 to your computer and use it in GitHub Desktop.
Save skellock/41d405e194c83ebe5c73eb6a32965b76 to your computer and use it in GitHub Desktop.
import React, { Component, PropTypes } from 'react'
import { TouchableOpacity, Text } from 'react-native'
// Your average run of the mill Button component.
export default class Button extends Component {
render () {
return (
<TouchableOpacity onPress={this.props.onPress}>
<Text>{this.props.text}</Text>
</TouchableOpacity>
)
}
}
// configured from the parent
Button.propTypes = {
onPress: PropTypes.func.isRequired,
text: PropTypes.string.isRequired
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment