File tree Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,14 @@ import React from 'react'
4
4
import ReactDOM from 'react-dom'
5
5
6
6
import { initSentry } from './utils/sentry'
7
- import { Provider } from 'react-redux'
8
- import { LocalizeProvider } from 'react-localize-redux' ;
9
- import { PersistGate } from 'redux-persist/integration/react'
10
-
11
7
import Routing from './components/Routing'
12
- import { store , persistor , history } from './redux/store'
8
+ import StoreConfiguration from './redux/store'
13
9
14
10
initSentry ( ) ;
15
11
16
12
ReactDOM . render (
17
- < Provider store = { store } >
18
- < PersistGate loading = { null } persistor = { persistor } >
19
- < LocalizeProvider store = { store } >
20
- < Routing history = { history } />
21
- </ LocalizeProvider >
22
- </ PersistGate >
23
- </ Provider > ,
13
+ < StoreConfiguration >
14
+ < Routing history = { history } />
15
+ </ StoreConfiguration > ,
24
16
document . getElementById ( 'root' )
25
17
)
Original file line number Diff line number Diff line change
1
+ import React from 'react'
1
2
import { createStore } from 'redux'
2
3
import { persistStore , persistReducer } from 'redux-persist'
3
4
import storage from 'redux-persist/lib/storage'
4
5
import { createBrowserHistory } from 'history'
5
6
7
+ import { Provider } from 'react-redux'
8
+ import { LocalizeProvider } from 'react-localize-redux' ;
9
+ import { PersistGate } from 'redux-persist/integration/react'
10
+
6
11
import createRootReducer from '../reducers'
7
12
import createMiddleware from '../middleware'
8
13
@@ -11,10 +16,20 @@ const persistConfig = {
11
16
storage,
12
17
}
13
18
14
- export const history = createBrowserHistory ( )
19
+ const history = createBrowserHistory ( )
15
20
16
21
const persistedReducer = persistReducer ( persistConfig , createRootReducer ( history ) )
17
22
18
23
export const store = createStore ( persistedReducer , createMiddleware ( history ) )
19
24
20
- export let persistor = persistStore ( store )
25
+ let persistor = persistStore ( store )
26
+
27
+ export default ( { children } ) => (
28
+ < Provider store = { store } >
29
+ < PersistGate loading = { null } persistor = { persistor } >
30
+ < LocalizeProvider store = { store } >
31
+ { children }
32
+ </ LocalizeProvider >
33
+ </ PersistGate >
34
+ </ Provider >
35
+ )
You can’t perform that action at this time.
0 commit comments