-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
40 lines (36 loc) · 1.14 KB
/
App.js
File metadata and controls
40 lines (36 loc) · 1.14 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
import React from 'react';
import {Provider} from 'react-redux';
import {StatusBar} from 'react-native';
import FlashMessage from 'react-native-flash-message';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {COLORS} from '@constants/index';
import AppNavigator from './src/navigation';
import {StyledText} from '@components/atoms';
import {getStore, getPersistor} from '@redux/index';
import {PersistGate} from 'redux-persist/integration/react';
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}>
<StatusBar
barStyle="light-content"
animated
backgroundColor={COLORS.BACKGROUND}
/>
<AppNavigator />
<FlashMessage position="bottom" />
</PersistGate>
</Provider>
</SafeAreaProvider>
);
};
export default App;