-
Notifications
You must be signed in to change notification settings - Fork 322
/
Copy pathApp.tsx
39 lines (32 loc) · 1.01 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
import * as Sentry from '@sentry/react-native';
import Constants from 'expo-constants';
import App from './src/app';
// TODO: It is a temporary fix to fix the reanimated logger issue
// Ref: https://github.com/gorhom/react-native-bottom-sheet/issues/1983
// https://github.com/dohooo/react-native-reanimated-carousel/issues/706
import './reanimatedConfig';
// import './wdyr';
const isStorybookEnabled = Constants.expoConfig?.extra?.eas?.storybookEnabled;
if (!__DEV__) {
Sentry.init({
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1.0,
attachScreenshot: true,
});
}
if (__DEV__) {
// eslint-disable-next-line
require('./ReactotronConfig');
}
// Ref: https://dev.to/dannyhw/how-to-swap-between-react-native-storybook-and-your-app-p3o
export default (() => {
if (isStorybookEnabled === 'true') {
// eslint-disable-next-line
return require('./.storybook').default;
}
if (!__DEV__) {
return Sentry.wrap(App);
}
console.log('Loading Development App');
return App;
})();