-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
48 lines (43 loc) · 1.33 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
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React, { Suspense } from 'react';
import { useColorScheme } from 'react-native';
import { ThemeProvider } from 'styled-components/native';
import { darkTheme, lightTheme } from './theme';
import { RecoilRoot } from 'recoil';
import AppIndex from './AppIndex';
import * as Sentry from '@sentry/react-native';
Sentry.init({
dsn: 'https://90ba4ed4a98e4938bf0bc303153de393@o4504253700046848.ingest.sentry.io/4504253707714560',
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
tracesSampleRate: 1.0,
});
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnMount: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
suspense: true,
retry: 2,
},
},
});
const Nanez = () => {
const isDark = useColorScheme() === 'dark';
return (
<ThemeProvider theme={isDark ? darkTheme : lightTheme}>
<RecoilRoot>
<Suspense fallback={null}>
<QueryClientProvider client={queryClient}>
<AppIndex />
</QueryClientProvider>
</Suspense>
</RecoilRoot>
</ThemeProvider>
);
};
const App = () => {
return <Nanez />;
};
export default Sentry.wrap(App);