-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathApp.tsx
38 lines (31 loc) · 1.11 KB
/
App.tsx
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
import {LogBox} from 'react-native';
import React, {useCallback, useEffect, useState} from 'react';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {AppNavigator} from './src/app';
import {configureDesignSystem} from './src/utils/designSystem';
import {hydrateStores, StoresProvider} from './src/stores';
import {initServices, ServicesProvider} from './src/services';
LogBox.ignoreLogs([
'EventEmitter.removeListener',
'`new NativeEventEmitter()`',
'[react-native-gesture-handler] Seems like', // https://github.com/software-mansion/react-native-gesture-handler/issues/1831
]);
export default (): JSX.Element => {
const [ready, setReady] = useState(false);
const startApp = useCallback(async () => {
await hydrateStores();
await initServices();
configureDesignSystem();
setReady(true);
}, []);
useEffect(() => {
startApp();
}, [startApp]);
return (
<GestureHandlerRootView style={{flex: 1}}>
<StoresProvider>
<ServicesProvider>{ready ? <AppNavigator /> : null}</ServicesProvider>
</StoresProvider>
</GestureHandlerRootView>
);
};