App.js 1.1 KB

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