-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.tsx
43 lines (36 loc) · 1.17 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
import 'react-native-gesture-handler';
import React from 'react';
import { createStore, applyMiddleware, compose } from 'redux';
import { Provider } from 'react-redux';
import { persistStore } from 'redux-persist';
import { PersistGate } from 'redux-persist/integration/react';
import ReduxThunk from 'redux-thunk';
import NetInfo from '@react-native-community/netinfo';
import '@i18n';
import { ConfigProvider } from '@config';
import reducers from './src/store';
import TabNavigator from './src/navigators/TabNavigator';
import defaultConfig from './defaultConfig';
const App: React.FC = () => {
const composeEnhancers =
(window && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose;
const store = createStore(
reducers,
{},
composeEnhancers(applyMiddleware(ReduxThunk))
);
const persistor = persistStore(store);
NetInfo.configure({
reachabilityShouldRun: () => false,
});
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<ConfigProvider defaultConfig={defaultConfig}>
<TabNavigator />
</ConfigProvider>
</PersistGate>
</Provider>
);
};
export default App;