Skip to content

Instantly share code, notes, and snippets.

@brentvatne
Created July 7, 2015 22:08
Show Gist options
  • Select an option

  • Save brentvatne/a61355f95427b3b608ab to your computer and use it in GitHub Desktop.

Select an option

Save brentvatne/a61355f95427b3b608ab to your computer and use it in GitHub Desktop.
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
} = React;
var TextExample = React.createClass({
layoutView() {
console.log(arguments);
},
render: function() {
return (
<View style={styles.container}>
<Text onPress={() => console.log('hi')}
style={{fontSize: 25}}>
hi there!!
</Text>
<Text onPress={() => console.log('hi')}
style={{fontSize: 25, color: 'green'}}>
hi again!
</Text>
<Text style={{fontSize: 25}}>
look, no highlight!
</Text>
<Text suppressHighlighting={true}>
Hi there this is <Text suppressHighlighting={false} style={{color: 'blue'}} onPress={() => {}}>nested!</Text>
<Text> so you can just use it like a link</Text>
</Text>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('TextExample', () => TextExample);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment