-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
51 lines (46 loc) · 1.32 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from 'react';
import { StyleSheet, Text, View ,StatusBar} from 'react-native';
import Home from './screens/Home';
import { Label } from './screens/components/Global_Components';
import {createAppContainer,createStackNavigator,createDrawerNavigator} from 'react-navigation';
import TestBoard from './screens/TestBoard';
import Drawer from './screens/components/Drawer';
import ErrorView from './screens/components/ErrorView';
const drawer=createDrawerNavigator({
Home:Home
},{
initialRouteName:"Home",
contentComponent:Drawer,
drawerOpenRoute:"DrawerOpen",
drawerCloseRoute:"DrawerClose",
drawerToggleRoute:"DrawerToggle"
});
const root = createStackNavigator(
{
Home: drawer,
TestBoard:TestBoard,
Error:ErrorView
}, {
initialRouteName: "Home",
headerMode:"none"
});
const AppContainer=createAppContainer(root);
export default class App extends React.Component{
static getDerivedStateFromError(error) {
// Update state so the next render will show the fallback UI.
console.log(error);
return { hasError: true };
}
render(){
return (
<View style={styles.container}>
<AppContainer/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});