Add app.js

This commit is contained in:
ugiacoman 2017-07-04 18:57:25 -04:00
parent a870354a18
commit 0fbbae031a
2 changed files with 22 additions and 32 deletions

12
example/demo/app.js Normal file
View File

@ -0,0 +1,12 @@
import React from 'react'
import { View } from 'react-native'
export default class App extends React.Component {
render () {
return (
<View
style={{flex: 1, backgroundColor: 'red'}}
/>
)
}
}

View File

@ -4,50 +4,28 @@
* @flow
*/
import React, { Component } from 'react';
import React, { Component } from 'react'
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
} from 'react-native'
import App from './app'
export default class demo extends Component {
render() {
render () {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.android.js
</Text>
<Text style={styles.instructions}>
Double tap R on your keyboard to reload,{'\n'}
Shake or press menu button for dev menu
</Text>
<App />
</View>
);
)
}
}
const 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,
},
});
flex: 1
}
})
AppRegistry.registerComponent('demo', () => demo);
AppRegistry.registerComponent('demo', () => demo)