Upgrading to react 17.0.0 breaks connected-react-router which breaks react-admin
See original GitHub issueEverything was running fine, but after I upgraded React to 17.0.0, react-admin stopped working, because of an incompatibility between connected-react-router and react 17.0.0:
Error: Could not find “store” in the context of “Connect(withRouter(WithStyles(Layout)))”. Either wrap the root component in a
<Provider>
, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(withRouter(WithStyles(Layout))) in connect options.
I really like react-admin, but it could move away from connected-react-router
. This lib is not updated regularly and I’ve had so many trouble with it before.
Here are my lib versions:
"connected-react-router": "^6.8.0",
"history": "4.10.1",
"react": "^17.0.1",
"react-admin": "^3.9.6",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
I think there is a workaround passing a context do <ConnectedRouter>
, but then I would need to stop using the <Admin>
and implement it by myself, which would be a big pain to refactor all my resources
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
I have the same problem without a custom redux store. I juste use Admin as in examples and I have the same error.
Did you found a workaround ?
It may be fixed when #5453 is merged and
3.10
released. I haven’t got this error when upgrading the examples.