forked from kale5195/bsats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
40 lines (36 loc) · 1.35 KB
/
App.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
import 'expo-dev-client';
import { useEffect, useCallback } from 'react';
import * as SplashScreen from 'expo-splash-screen';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { ToastProvider } from 'react-native-toast-notifications';
import { QueryClient, QueryClientProvider } from 'react-query';
import { StoresProvider, hydrateStores } from '~/stores';
import AppNavigator from './src/navigation/navigator';
import { queryClient } from '~/services/queryClient';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
export default function App() {
const startApp = useCallback(async () => {
// await SplashScreen.preventAutoHideAsync();
await hydrateStores();
//await SplashScreen.hideAsync();
}, []);
useEffect(() => {
startApp();
}, [startApp]);
return (
<SafeAreaProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<BottomSheetModalProvider>
<StoresProvider>
<ToastProvider offsetBottom={80} duration={2000}>
<QueryClientProvider client={queryClient}>
<AppNavigator />
</QueryClientProvider>
</ToastProvider>
</StoresProvider>
</BottomSheetModalProvider>
</GestureHandlerRootView>
</SafeAreaProvider>
);
}