-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
42 lines (37 loc) · 1.17 KB
/
App.js
File metadata and controls
42 lines (37 loc) · 1.17 KB
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
import React from 'react';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import AppNavigator from './src/navigation';
import {getStore, getPersistor} from '@redux/index';
import CodePush from 'react-native-code-push';
import {Platform} from 'react-native';
import Config from 'react-native-config';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import {StyledText} from '@components/atoms';
const codePushOptions = {
deploymentKey: Platform.select({
android: Config.CODE_PUSH_ANDROID,
ios: Config.CODE_PUSH_IOS,
}),
mandatoryInstallMode: CodePush.InstallMode.IMMEDIATE,
};
const App = () => {
const store = getStore();
const persistor = getPersistor();
const onBeforeLift = () => {
//Do some stuff that when redux has initialized
};
return (
<SafeAreaProvider>
<Provider store={store}>
<PersistGate
loading={<StyledText>Loading...</StyledText>}
persistor={persistor}
onBeforeLift={onBeforeLift}>
<AppNavigator />
</PersistGate>
</Provider>
</SafeAreaProvider>
);
};
export default CodePush(codePushOptions)(App);