Created
August 30, 2015 18:05
-
-
Save idiomatic/23a83c014ba49e2255cd to your computer and use it in GitHub Desktop.
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
### | |
# Sample React Native App | |
# https://github.com/facebook/react-native | |
### | |
'use strict' | |
React = require 'react-native' | |
{AppRegistry, StyleSheet, Text, View} = React | |
CoffeeProject = React.createClass | |
displayName: 'CoffeeProject' | |
render: -> | |
React.createElement View, style: styles.container, | |
React.createElement Text, style: styles.welcome, 'Welcome to React Native!' | |
React.createElement Text, style: styles.instructions, 'To get started, edit index.ios.coffee' | |
React.createElement Text, style: styles.instructions, 'Press Cmd+R to reload,', '\n', 'Cmd+D or shake for dev menu' | |
styles = StyleSheet.create | |
container: | |
flex: 1 | |
justifyContent: 'center' | |
alignItems: 'center' | |
backgroundColor: '#6F4E37' | |
welcome: | |
fontSize: 20 | |
textAlign: 'center' | |
margin: 10 | |
color: '#cccccc' | |
instructions: | |
textAlign: 'center' | |
color: '#cccccc' | |
marginBottom: 5 | |
AppRegistry.registerComponent 'CoffeeProject', -> | |
CoffeeProject |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
*/ | |
'use strict'; | |
var React = require('react-native'); | |
var { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
} = React; | |
var AwesomeProject = React.createClass({ | |
render: function() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}> | |
Welcome to React Native! | |
</Text> | |
<Text style={styles.instructions}> | |
To get started, edit index.ios.js | |
</Text> | |
<Text style={styles.instructions}> | |
Press Cmd+R to reload,{'\n'} | |
Cmd+D or shake for dev menu | |
</Text> | |
</View> | |
); | |
} | |
}); | |
var styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF', | |
}, | |
welcome: { | |
fontSize: 20, | |
textAlign: 'center', | |
margin: 10, | |
}, | |
instructions: { | |
textAlign: 'center', | |
color: '#333333', | |
marginBottom: 5, | |
}, | |
}); | |
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment