-
Notifications
You must be signed in to change notification settings - Fork 37
/
index.js
59 lines (55 loc) · 1.85 KB
/
index.js
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
import './shim'
import React from 'react'
import { ErrorBoundary } from 'react-error-boundary'
import { AppRegistry } from 'react-native'
import 'react-native-gesture-handler'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import 'react-native-url-polyfill/auto'
import { Provider as ReduxProvider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import { name as appName } from './app.json'
import App from './src/app/App'
import { GlobalError } from './src/components/GlobalError'
import AccountStorageProvider from './src/config/storage/AccountStorageProvider'
import AppStorageProvider from './src/config/storage/AppStorageProvider'
import LanguageProvider from './src/config/storage/LanguageProvider'
import NotificationStorageProvider from './src/config/storage/NotificationStorageProvider'
import { persistor } from './src/store/persistence'
import store from './src/store/store'
import './src/utils/i18n'
// eslint-disable-next-line no-undef
if (__DEV__) {
import('./ReactotronConfig')
}
function fallbackRender(props) {
return (
<SafeAreaProvider>
<GlobalError {...props} />
</SafeAreaProvider>
)
}
const render = () => {
return (
<ErrorBoundary
fallbackRender={fallbackRender}
onReset={async () => {
await persistor.purge()
}}
>
<ReduxProvider store={store}>
<PersistGate loading={null} persistor={persistor}>
<LanguageProvider>
<AppStorageProvider>
<AccountStorageProvider>
<NotificationStorageProvider>
<App />
</NotificationStorageProvider>
</AccountStorageProvider>
</AppStorageProvider>
</LanguageProvider>
</PersistGate>
</ReduxProvider>
</ErrorBoundary>
)
}
AppRegistry.registerComponent(appName, () => render)