App.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. type Props = {};
  17. export default class App extends Component<Props> {
  18. render() {
  19. return (
  20. <View style={styles.container}>
  21. <Text style={styles.welcome}>Welcome to React Native!</Text>
  22. <Text style={styles.instructions}>To get started, edit App.js</Text>
  23. <Text style={styles.instructions}>{instructions}</Text>
  24. </View>
  25. );
  26. }
  27. }
  28. const styles = StyleSheet.create({
  29. container: {
  30. flex: 1,
  31. justifyContent: 'center',
  32. alignItems: 'center',
  33. backgroundColor: '#F5FCFF',
  34. },
  35. welcome: {
  36. fontSize: 20,
  37. textAlign: 'center',
  38. margin: 10,
  39. },
  40. instructions: {
  41. textAlign: 'center',
  42. color: '#333333',
  43. marginBottom: 5,
  44. },
  45. });