Skip to content
This repository was archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
Add <base href> support for router
Browse files Browse the repository at this point in the history
Update to history was required due to remix-run/history#139
  • Loading branch information
jnv committed Nov 15, 2015
1 parent ba92f3a commit 5a7caae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"file-loader": "^0.8.4",
"font-awesome": "^4.4.0",
"hammerjs": "^2.0.4",
"history": "^1.13.0",
"history": "^1.13.1",
"moment": "^2.10.6",
"moment-timezone": "^0.4.1",
"ramda": "^0.18.0",
Expand Down
7 changes: 5 additions & 2 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { compose, createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import { mergePersistedState } from 'redux-localstorage'
import { reduxReactRouter } from 'redux-router'
import { createHistory } from 'history'
import { createHistory, useBasename } from 'history'

import rootReducer from '../reducers'
import routes from '../routes'
Expand All @@ -20,12 +20,15 @@ const reducer = compose(
mergePersistedState()
)(rootReducer)

// Use history with <base href> support
const history = useBasename(createHistory)()

// Store enhancers
let finalCreateStore = compose(
applyMiddleware(...middlewares),
reduxReactRouter({
routes,
createHistory,
history,
})
)(createStore)

Expand Down

0 comments on commit 5a7caae

Please sign in to comment.