Skip to content

Instantly share code, notes, and snippets.

@markthethomas
Created November 18, 2015 17:14
Show Gist options
  • Save markthethomas/793b824cb3b8d931fe35 to your computer and use it in GitHub Desktop.
Save markthethomas/793b824cb3b8d931fe35 to your computer and use it in GitHub Desktop.
react native part 3
'use strict';
const React = require('react-native');
const {
AppRegistry,
StyleSheet,
Text,
Image,
View,
} = React;
const myProjectName = React.createClass({
render: function() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Fall has come at last!
</Text>
<View style={{flex: 1}}>
<Image style={styles.image} source={require('./assets/fall.jpg')}/>
</View>
</View>
);
}
});
const styles = StyleSheet.create({
image: {
width: 400,
height: 500
},
container: {
flex: 1,
paddingTop: 20,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('myProjectName', () => myProjectName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment