-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.js
41 lines (38 loc) · 1.39 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
import 'react-native-gesture-handler';
import './global';
import ErrorBoundary from 'components/errors/ErrorBoundary';
import React, {useState} from 'react';
import {AppRegistry, LogBox, StatusBar} from 'react-native';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import MultichainApp from 'src/MultichainApp';
import {persistor, store} from 'store';
import {name as appName} from './app.json';
const Root = () => {
const [gateLifted, setGateLifted] = useState(false);
LogBox.ignoreLogs([
'Non-serializable values were found in the navigation state',
"Looks like you're passing an inline function",
"EventEmitter.removeListener('change', ...): ",
'ViewPropTypes will be removed from React Native',
"EventEmitter.removeListener('appStateDidChange', ...)",
]);
const onBeforeLift = () => {
// Take an action before the gate lifts
setGateLifted(true);
};
return (
<ErrorBoundary>
<SafeAreaProvider>
<Provider store={store}>
<StatusBar backgroundColor="black" />
<PersistGate persistor={persistor} onBeforeLift={onBeforeLift}>
{gateLifted ? <MultichainApp /> : null}
</PersistGate>
</Provider>
</SafeAreaProvider>
</ErrorBoundary>
);
};
AppRegistry.registerComponent(appName, () => Root);