-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.tsx
More file actions
48 lines (43 loc) · 1.65 KB
/
App.tsx
File metadata and controls
48 lines (43 loc) · 1.65 KB
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 'react-native-gesture-handler';
import React from 'react';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import {NavigationContainer} from '@react-navigation/native';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {MainRoutes} from './routes';
import ErrorBoundary from './screens/components/ErrorBoundary';
import * as Sentry from '@sentry/react-native';
import Config from 'react-native-config';
import configureAppStore from './store';
import {IS_PRODUCTION} from './actions/types';
import setupAxiosInterceptors from './utils/setupAxiosInterceptors';
import './i18n';
const SENTRY_DSN = Config.SENTRY_DSN;
const {store, persistor} = configureAppStore();
setupAxiosInterceptors(store);
if (IS_PRODUCTION && SENTRY_DSN) {
Sentry.init({
dsn: SENTRY_DSN,
tracePropagationTargets: []
});
}
const App = () => {
return (
// eslint-disable-next-line react-native/no-inline-styles
<GestureHandlerRootView style={{flex: 1}}>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<SafeAreaProvider>
<ErrorBoundary>
<NavigationContainer>
<MainRoutes />
</NavigationContainer>
</ErrorBoundary>
</SafeAreaProvider>
</PersistGate>
</Provider>
</GestureHandlerRootView>
);
};
export default IS_PRODUCTION ? Sentry.wrap(App) : App;