Skip to content

Instantly share code, notes, and snippets.

@sahrens
Created May 1, 2015 20:26
Show Gist options
  • Save sahrens/58057ff90c13268b62d0 to your computer and use it in GitHub Desktop.
Save sahrens/58057ff90c13268b62d0 to your computer and use it in GitHub Desktop.
React Native text crash
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