Skip to content

Instantly share code, notes, and snippets.

Created August 30, 2015 18:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# Sample React Native App
'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'
React.createElement Text, style: styles.instructions, 'Press Cmd+R to reload,', '\n', 'Cmd+D or shake for dev menu'
styles = StyleSheet.create
flex: 1
justifyContent: 'center'
alignItems: 'center'
backgroundColor: '#6F4E37'
fontSize: 20
textAlign: 'center'
margin: 10
color: '#cccccc'
textAlign: 'center'
color: '#cccccc'
marginBottom: 5
AppRegistry.registerComponent 'CoffeeProject', ->
* Sample React Native App
'use strict';
var React = require('react-native');
var {
} = React;
var AwesomeProject = React.createClass({
render: function() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
<Text style={styles.instructions}>
To get started, edit index.ios.js
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
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