Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import {View,Text,TouchableOpacity, AppRegistry, StyleSheet} from 'react-native';
  3. import {observer} from 'mobx-react/native';
  4.  
  5.  
  6.  
  7. @observer
  8. class App extends Component {
  9. render() {
  10. return (
  11. <View style={styles.container}>
  12. <TouchableOpacity onPress={this.onReset}>
  13. <View >
  14. <Text >Seconds passed: {this.props.appState.timer}</Text>
  15. </View>
  16. </TouchableOpacity>
  17. </View>
  18. );
  19. }
  20.  
  21. onReset = () => {
  22. this.props.appState.resetTimer();
  23. }
  24.  
  25. }
  26.  
  27.  
  28. const styles = StyleSheet.create({
  29. container: {
  30. flex: 1,
  31. justifyContent: 'center',
  32. alignItems: 'center',
  33. backgroundColor: '#F5FCFF',
  34. },
  35.  
  36. });
  37.  
  38. export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement