-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
88 lines (70 loc) · 2.15 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from 'react';
import {
useColorScheme,
Text,
Dimensions,
} from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { Provider } from 'react-redux';
// import { createStore } from 'redux';
import { configureStore } from '@reduxjs/toolkit'
import {
persistStore, persistReducer, FLUSH,
REHYDRATE,
PAUSE,
PERSIST,
PURGE,
REGISTER,
} from 'redux-persist';
// import storage from 'redux-persist/lib/storage'; // defaults to localStorage for web
import { PersistGate } from 'redux-persist/integration/react';
import Routes from './Routes';
import reducer from './src/redux/reducer';
import * as Sentry from "@sentry/react-native";
Sentry.init({
dsn: "https://[email protected]/4506953342320640",
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
tracesSampleRate: 1.0,
});
// TODO: timeout setting not working in debug mode
const persistConfig = {
key: 'root',
storage: AsyncStorage,
blacklist: ['searchState', 'modalState', 'playerState'],
timeout: null,
};
const persistedReducer = persistReducer(persistConfig, reducer);
// const store = createStore(persistedReducer);
const store = configureStore({
reducer: persistedReducer,
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
immutableCheck: false, // Disable immutable checks
serializableCheck: {
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
},
}),
});
const persistor = persistStore(store);
// config Text not changed by system font scale
Text.defaultProps = Text.defaultProps || {};
Text.defaultProps.allowFontScaling = false;
const window = Dimensions.get('window');
function App(): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Routes />
</PersistGate>
</Provider>
)
}
export default Sentry.wrap(App);