Skip to content

Commit 0dac56f

Browse files
authored
Merge pull request #8 from monkeyInShell/feature-config-browserhistory
config browserhistory:historyConf
2 parents 2c18f73 + b40ad59 commit 0dac56f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

client/pages/integration/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import React from 'react'
55
import ReactDom from 'react-dom'
66
import Root from './Root/index'
77
import App from './App'
8-
import storeFactory, {history} from '../tools/store/forBrowser'
8+
import storeFactory, {historyConf} from '../tools/store/forBrowser'
99
import reducers from './store/'
1010
const store = storeFactory(reducers)
11+
const history = historyConf({
12+
basename: '/integration'
13+
})
1114
ReactDom.hydrate(
1215
<Root store={store} history={history} component={App} />,
1316
document.getElementById('bd')

client/pages/tools/store/forBrowser.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {routerMiddleware} from 'react-router-redux'
66
import {applyMiddleware, combineReducers} from 'redux'
77
import {createBrowserHistory} from 'history'
88
import configureStore from '../configure/store'
9-
const history = createBrowserHistory({
10-
basename: '/integration'
11-
})
9+
const historyConf = (options) => {
10+
return createBrowserHistory(options)
11+
}
1212

1313
const middlewares = middleware.concat(routerMiddleware(history))
1414

@@ -19,5 +19,5 @@ const store = reducers => {
1919
applyMiddleware(...middlewares)
2020
)
2121
}
22-
export {history}
22+
export {historyConf}
2323
export default store

0 commit comments

Comments
 (0)