App.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Sample React Native App
  3. * https://github.com/facebook/react-native
  4. *
  5. * @format
  6. * @flow
  7. */
  8. import React, {Component} from 'react';
  9. import {Platform, StyleSheet, Text, View} from 'react-native';
  10. const instructions = Platform.select({
  11. ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  12. android:
  13. 'Double tap R on your keyboard to reload,\n' +
  14. 'Shake or press menu button for dev menu',
  15. });
  16. export default class App extends Component{
  17. render() {
  18. return (
  19. <View style={styles.container}>
  20. <Text style={styles.welcome}>Welcome to React Native!</Text>
  21. <Text style={styles.instructions}>To get started, edit App.js</Text>
  22. <Text style={styles.instructions}>{instructions}</Text>
  23. </View>
  24. );
  25. }
  26. }
  27. const styles = StyleSheet.create({
  28. container: {
  29. flex: 1,
  30. justifyContent: 'center',
  31. alignItems: 'center',
  32. backgroundColor: '#F5FCFF',
  33. },
  34. welcome: {
  35. fontSize: 20,
  36. textAlign: 'center',
  37. margin: 10,
  38. },
  39. instructions: {
  40. textAlign: 'center',
  41. color: '#333333',
  42. marginBottom: 5,
  43. },
  44. });