-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
37 lines (33 loc) · 849 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React, {Component} from 'react';
import {Platform, StyleSheet, View} from 'react-native';
import RiddleNavigator from './src/navigation/home/RiddleNavigator';
import AppContext from './AppContext';
export default class App extends Component{
constructor(){
super()
this.state = {
points:0,
}
}
render() {
return (
<AppContext.Provider value={{
state:this.state,
change_points_by: (pnt)=> this.setState({
points:this.state.points+pnt
})
}}>
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
<RiddleNavigator />
</View>
</AppContext.Provider>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF',
}
});