Open zedtux opened 6 years ago
I'm trying to replace the deprecated react-router-redux
with connected-react-router
and doesn't seem hard to do the migration but I'm stuck on an error.
I did a fork of the rekit-app with the migration I did, I marked it as WIP until the issue is fixed, you can see what I've changed.
I followed the connected-react-router's README.md.
@supnate can you please have a quick look to my PR and let me know if you find what I'm doing wrong?
In the error stack, the part from my project is this :
renderApp
src/index.js:13
10 | const store = configStore();
11 |
12 | function renderApp(app) {
> 13 | render(
14 | <AppContainer>
15 | {app}
16 | </AppContainer>,
View compiled
(anonymous function)
src/index.js:21
18 | );
19 | }
20 |
> 21 | renderApp(<Root store={store} routeConfig={routeConfig} />);
22 |
23 | // Hot Module Replacement API
24 | /* istanbul ignore if */
View compiled
then it's going through the dependencies from the node_modules/
to end on the following :
TypeError: undefined is not an object (evaluating 'context.store.subscribe')
ConnectedRouter
node_modules/connected-react-router/lib/ConnectedRouter.js:55
52 | _this.inTimeTravelling = false;
53 |
54 | // Subscribe to store changes
> 55 | _this.unsubscribe = context.store.subscribe(function () {
| ^ 56 | // Extract store's location
57 | var _toJS = toJS(getIn(context.store.getState(), ['router', 'location'])),
58 | pathnameInStore = _toJS.pathname,
View compiled
Last information : I migrated to webpack 4 following this comment as I was facing an issue with webpack 3.
Rekit create app is generated a
package.json
file which includes thereact-router-redux
package which is not deprecated.The author recommend
connected-react-router
.Rekit should migrate.