In earlier versions history was a peerDependency, this is no longer the case since version 2 has its own history management tool. This means that the arguments passed to connectRoutes(documentation) need to be changed from this:
const { reducer, middleware, enhancer, thunk } = connectRoutes(
history,
routesMap,
options
)to this:
const { reducer, middleware, enhancer, thunk } = connectRoutes(
routesMap, {
...options,
initialEntries
})If you're using a custom history type, you can still import createHashHistory or createMemoryHistory from either the history package or rudy-history and add to your options as createHistory.
Change commit in redux-first-router-demo: here.
And inside of your configureStore.js file if you are server side rendering, change this:
const history = createHistory({ initialEntries: [req.path] })
const { store, thunk } = configureStore(history, preLoadedState)To this:
const { store, thunk } = configureStore(preLoadedState, [req.path])Change commit in redux-first-router-demo: here.