-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
47 lines (42 loc) · 1.17 KB
/
index.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
/** @format */
import React, { Component } from "react";
import { AppRegistry, StatusBar, BackHandler, Platform } from "react-native";
import GameNavigator from "./src/Main";
import { Provider } from "react-redux";
import { persistor, pStore } from "./src/redux/store";
import { PersistGate } from "redux-persist/lib/integration/react";
import { name as appName } from "./app.json";
class App extends Component {
constructor(props) {
super(props);
}
componentWillMount() {
if (Platform.OS == "android") {
BackHandler.addEventListener("hardwareBackPress", () => {
return true;
});
}
}
componentWillUnmount() {
if (Platform.OS == "android") {
BackHandler.removeEventListener("hardwareBackPress", () => {
return true;
});
}
}
render() {
return (
<Provider store={pStore}>
<PersistGate loading={null} persistor={persistor}>
<StatusBar //doubt for ios
hidden={true}
backgroundColor={"#4d9900"}
barStyle="light-content"
/>
<GameNavigator />
</PersistGate>
</Provider>
);
}
}
AppRegistry.registerComponent(appName, () => App);