Skip to content

Instantly share code, notes, and snippets.

@write2lloyd
Created November 22, 2017 06:48
Show Gist options
  • Save write2lloyd/6a64887844601ab961f6f2c436a426d7 to your computer and use it in GitHub Desktop.
Save write2lloyd/6a64887844601ab961f6f2c436a426d7 to your computer and use it in GitHub Desktop.
ReactNative Pass data from components
export default class LoginButton extends Component {
changeText = () => {
this.props.buttonClicked(this.props.title);
}
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={this.changeText}>
<Text style = {styles.text}>
{this.props.title}
</Text>
</TouchableOpacity>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment