Skip to content

Commit 957903a

Browse files
author
yunkui.zhou
committed
forBrower store add a param history
1 parent 0dac56f commit 957903a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

client/pages/integration/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import Root from './Root/index'
77
import App from './App'
88
import storeFactory, {historyConf} from '../tools/store/forBrowser'
99
import reducers from './store/'
10-
const store = storeFactory(reducers)
1110
const history = historyConf({
1211
basename: '/integration'
1312
})
13+
const store = storeFactory(reducers, history)
14+
1415
ReactDom.hydrate(
1516
<Root store={store} history={history} component={App} />,
1617
document.getElementById('bd')

client/pages/tools/store/forBrowser.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ const historyConf = (options) => {
1010
return createBrowserHistory(options)
1111
}
1212

13-
const middlewares = middleware.concat(routerMiddleware(history))
14-
15-
const store = reducers => {
13+
const store = (reducers, history) => {
14+
const middlewares = middleware.concat(routerMiddleware(history))
1615
return configureStore(
1716
combineReducers(reducers),
1817
{},

0 commit comments

Comments
 (0)