Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import {View,Text,TouchableOpacity, AppRegistry, StyleSheet} from 'react-native';
- import {observer} from 'mobx-react/native';
- @observer
- class App extends Component {
- render() {
- return (
- <View style={styles.container}>
- <TouchableOpacity onPress={this.onReset}>
- <View >
- <Text >Seconds passed: {this.props.appState.timer}</Text>
- </View>
- </TouchableOpacity>
- </View>
- );
- }
- onReset = () => {
- this.props.appState.resetTimer();
- }
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: '#F5FCFF',
- },
- });
- export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement