-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
37 lines (28 loc) · 921 Bytes
/
App.js
File metadata and controls
37 lines (28 loc) · 921 Bytes
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
import React, { Component } from "react";
import { NavigationContainer } from "@react-navigation/native";
import DrawerNavigator from "./navigation/DrawerNavigator";
import SplashScreen from 'react-native-splash-screen'
import { LogBox, BackHandler } from "react-native";
import AsyncStorage from "@react-native-async-storage/async-storage";
export default class App extends Component {
handleBackPress = () => {
BackHandler.exitApp();
}
componentDidMount() {
SplashScreen.hide();
LogBox.ignoreAllLogs();
console.warn = () => { }
BackHandler.addEventListener("hardwareBackPress", this.handleBackPress);
AsyncStorage.setItem('guest', 'false');
}
componentWillUnmount() {
BackHandler.removeEventListener("hardwareBackPress", this.handleBackPress);
}
render() {
return (
<NavigationContainer>
<DrawerNavigator />
</NavigationContainer>
);
}
}