-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
46 lines (34 loc) · 952 Bytes
/
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
import React, { useEffect, useState } from 'react';
import AppNavigation from './src/navigation';
import {
useQuery,
useMutation,
useQueryClient,
QueryClient,
QueryClientProvider,
} from '@tanstack/react-query'
import userServiceStore from './src/services/api/zustandServiceStore';
import DeviceInfo from 'react-native-device-info';
import Toast from 'react-native-toast-message';
if (__DEV__) {
require("./ReactotronConfig");
}
// Create a client
const queryClient = new QueryClient()
const App = () => {
const setDeviceTyoe = userServiceStore((state) => state.setDeviceTyoe);
useEffect(() => {
async function checkDevice() {
let deviceType = await DeviceInfo.isEmulator() ? "Emulator" : "Phone";
setDeviceTyoe(deviceType)
}
checkDevice()
}, [])
return (
<QueryClientProvider client={queryClient}>
<AppNavigation />
<Toast />
</QueryClientProvider>
);
}
export default App;