Created
May 1, 2015 20:26
-
-
Save sahrens/58057ff90c13268b62d0 to your computer and use it in GitHub Desktop.
React Native text crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TextBug = React.createClass({ | |
getInitialState: function() { | |
return {seeMore: false}; | |
}, | |
render: function() { | |
return ( | |
<Text | |
style={styles.container} | |
onPress={() => this.setState({seeMore: !this.state.seeMore})}> | |
<Text>Tap to see more (bugs).</Text> | |
{this.state.seeMore && '...tap again.'} | |
</Text> | |
); | |
}, | |
}); | |
var styles = StyleSheet.create({ | |
container: { | |
margin: 10, | |
marginTop: 100, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment