Nenhuma descrição

index.ios.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * Sample React Native App
  3. * https://github.com/facebook/react-native
  4. * @flow
  5. */
  6. import React, { Component } from 'react';
  7. import {
  8. AppRegistry,
  9. StyleSheet,
  10. Text,
  11. View
  12. } from 'react-native';
  13. import RNIdle from 'react-native-idle'
  14. class Demo extends Component {
  15. componentDidMount() {
  16. RNIdle.disableIdleTimer()
  17. }
  18. render() {
  19. return (
  20. <View style={styles.container}>
  21. <Text style={styles.welcome}>
  22. Welcome to React Native!
  23. </Text>
  24. <Text style={styles.instructions}>
  25. To get started, edit index.ios.js
  26. </Text>
  27. <Text style={styles.instructions}>
  28. Press Cmd+R to reload,{'\n'}
  29. Cmd+D or shake for dev menu
  30. </Text>
  31. </View>
  32. );
  33. }
  34. }
  35. const styles = StyleSheet.create({
  36. container: {
  37. flex: 1,
  38. justifyContent: 'center',
  39. alignItems: 'center',
  40. backgroundColor: '#F5FCFF',
  41. },
  42. welcome: {
  43. fontSize: 20,
  44. textAlign: 'center',
  45. margin: 10,
  46. },
  47. instructions: {
  48. textAlign: 'center',
  49. color: '#333333',
  50. marginBottom: 5,
  51. },
  52. });
  53. AppRegistry.registerComponent('Demo', () => Demo);