Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SomeComponent(React.Component) {
- construct() {
- super();
- this.state = {
- userClicked: false
- }
- }
- render() {
- let text = '';
- if (this.state.userClicked) {
- text = (
- <Text style={{ fontWeight: 'bold', fontSize: 32 }}>
- User clicked you wankers!
- </Text>
- );
- }
- return (
- <View>
- {text{
- <Button
- onClick={() => this.setState({ userClicked: true })}
- disabled={this.state.userClicked}
- />
- </View>
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement