I'm creating routes and I'm stuck on syncHistoryWithStore
, it doesn't work. There are no errors on the console or anything, it just doesn't load components.
However if I simply use createBrowserHistory
without the sync it works, clicking links do change the components
import { createBrowserHistory } from 'history';
import { syncHistoryWithStore } from 'react-router-redux';
const store = createStore(reducers, applyMiddleware(thunk));
// Doesn't work: Doesn't load components, page doesn't change (without a full reload)
// No errors on the console
const history = syncHistoryWithStore(createBrowserHistory(), store);
// Works
// const history = createBrowserHistory();
render(
<Provider store={ store } key="provider">
<Router history={ history }>
...
<Switch>
<Route exact path="/" component={ Home } />
<Route path="/about" component={ About } />
<Route path="*" component={ NoMatch }/>
</Switch>
package.json
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.3",
"react-router": "^4.0.0",
"react-router-dom": "^4.0.0",
"react-router-redux": "^4.0.8",
"redux": "^3.6.0",
Is there anything specific that I have to do for this to work? Is there perhaps an example somewhere with the latest version of things?
Or should I just use createBrowserHistory
without the sync?