Open colin-byrne-1 opened 5 years ago
+1 @cobyrne09 - did you find a solution to this?
@SavageWilliam I ended up rolling back a couple packages, and haven't had any trouble. I would try rolling back react-router-redux before redux or redux-thunk. I am guessing the only one that matters is react-router-redux. I haven't had any issues with the alpha version. That said, I am sure something is going to force me to update sooner or later and I'll be sure to check back in on this thread when it does.
here are my current versions:
"prop-types": "15.7.2",
"react": "16.8.4",
"react-dom": "16.8.4",
"react-router-redux": "5.0.0-alpha.9",
"redux": "3.7.2",
"redux-thunk": "2.2.0",
+1
Am also facing this issue
Any solution for this issue ?
I don't have a proper solution for this, but I do have a hack that worked for me.
let history = { location: null };
if (typeof window === 'object') {
history = createBrowserHistory();
}
I had the same issue today when I tried to migrate from react-router-redux to connected-react router. For me the solution was that you need to provide the history param also in the hot reload part of your code.
if (module.hot) {
module.hot
.accept('../reducers', () => {
const nextRootReducer = require('../reducers/index');
store.replaceReducer(nextRootReducer(history));
});
}
There is also an example here: link
I am updating from
react-router-redux
, and keep gettingUncaught TypeError: Cannot read property 'location' of undefined
. I am not sure if this is a bug (I see similar errors caused by package version compatabilities, but mine look OK), or if my implementation of proptypes needs to change, or another issue is at play.//package.json
//app.js
//reducers/index.js
//index.js
//store/configurestore.js