forked from bitpay/bitpay-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
29 lines (26 loc) · 962 Bytes
/
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
import './shim';
import {AppRegistry} from 'react-native';
import Root from './src/Root';
import React from 'react';
import './i18n';
import {name as appName} from './app.json';
import getStore from './src/store';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import StorybookUIRoot from './storybook';
import {APP_LOAD_STORY_BOOK} from './src/constants/config';
import 'react-native-url-polyfill/auto'; // https://github.com/facebook/react-native/issues/23922#issuecomment-648096619
export const {store, persistor} = getStore();
const ReduxProvider = () => {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
{storeRehydrated =>
storeRehydrated &&
(__DEV__ && APP_LOAD_STORY_BOOK ? <StorybookUIRoot /> : <Root />)
}
</PersistGate>
</Provider>
);
};
AppRegistry.registerComponent(appName, () => ReduxProvider);