Created
July 7, 2015 22:08
-
-
Save brentvatne/a61355f95427b3b608ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * 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