Home:ALL Converter>Routes with syncHistoryWithStore doesn't work and doesn't show errors

Routes with syncHistoryWithStore doesn't work and doesn't show errors

Ask Time:2017-03-28T07:08:30         Author:BrunoLM

Json Formatter

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?

Author:BrunoLM,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/43057911/routes-with-synchistorywithstore-doesnt-work-and-doesnt-show-errors
yy