-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
50 lines (46 loc) · 1.51 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
39
40
41
42
43
44
45
46
47
48
49
50
import AsyncStorage from "@react-native-async-storage/async-storage";
import { NavigationContainer } from "@react-navigation/native";
import { ToastProvider, ToastViewport } from "@tamagui/toast";
import { createAsyncStoragePersister } from "@tanstack/query-async-storage-persister";
import { QueryClient } from "@tanstack/react-query";
import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client";
import { TamaguiProvider } from "tamagui";
import CurrentToast from "components/molecules/Taost";
import TabNavigator from "navigation/TabNavigator";
import tamaguiConfig from "theme/tamagui.config";
const queryClient = new QueryClient({
defaultOptions: {
queries: {
gcTime: Infinity,
staleTime: Infinity,
networkMode: "offlineFirst",
refetchOnMount: false, // Disabled for use with mock data
refetchOnReconnect: false, // Disabled for use with mock data
},
},
});
const asyncStoragePersister = createAsyncStoragePersister({
storage: AsyncStorage,
});
function App() {
return (
<PersistQueryClientProvider
client={queryClient}
persistOptions={{
persister: asyncStoragePersister,
maxAge: Infinity,
}}
>
<TamaguiProvider config={tamaguiConfig}>
<ToastProvider>
<NavigationContainer>
<TabNavigator />
<CurrentToast />
<ToastViewport />
</NavigationContainer>
</ToastProvider>
</TamaguiProvider>
</PersistQueryClientProvider>
);
}
export default App;