-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
34 lines (29 loc) · 1.04 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
// App.tsx
import React from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { View, ActivityIndicator } from 'react-native';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import RootNavigator from './navigation/RootNavigator';
import AppProviders from './contexts/AppProviders';
import useInitialization from './utils/useInitialization';
const queryClient = new QueryClient();
const App: React.FC = () => {
const { isReady, initialState, onStateChange } = useInitialization();
if (!isReady) {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<ActivityIndicator size="large" />
</View>
);
}
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<QueryClientProvider client={queryClient}>
<AppProviders>
<RootNavigator initialState={initialState} onStateChange={onStateChange} />
</AppProviders>
</QueryClientProvider>
</GestureHandlerRootView>
);
};
export default App;