mirror of
https://github.com/status-im/react-native.git
synced 2025-01-16 12:34:17 +00:00
a2c1170da5
Summary: This is a pretty useful trick to know, let's promote it :) The formatting is consistent with iOS: https://github.com/facebook/react-native/blob/master/local-cli/generator/templates/index.ios.js <img width="443" alt="screen shot 2016-06-23 at 4 04 47 pm" src="https://cloud.githubusercontent.com/assets/346214/16304185/fc94f6d6-395c-11e6-9f2c-0167217d1514.png"> Closes https://github.com/facebook/react-native/pull/8354 Differential Revision: D3475790 Pulled By: mkonicek fbshipit-source-id: 06a43cf73b31d91faac72280d680f8eb95f50145
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
/**
|
|
* Sample React Native App
|
|
* https://github.com/facebook/react-native
|
|
* @flow
|
|
*/
|
|
|
|
import React, { Component } from 'react';
|
|
import {
|
|
AppRegistry,
|
|
StyleSheet,
|
|
Text,
|
|
View
|
|
} from 'react-native';
|
|
|
|
class <%= name %> extends Component {
|
|
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>
|
|
</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,
|
|
},
|
|
});
|
|
|
|
AppRegistry.registerComponent('<%= name %>', () => <%= name %>);
|