question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading to react 17.0.0 breaks connected-react-router which breaks react-admin

See original GitHub issue

Everything 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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
EmrysMyrddincommented, Dec 2, 2020

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 ?

2reactions
djhicommented, Nov 6, 2020

It may be fixed when #5453 is merged and 3.10 released. I haven’t got this error when upgrading the examples.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-admin - Upgrading to v4 - Marmelab
If your code used useSelector to read the react-admin application state, it will break. React-admin v4 doesn't use Redux anymore. React-admin no longer...
Read more >
connected-react-router - npm
Breaking change in v5.0.0! Please read How to migrate from v4 to v5/v6. v6.0.0 requires React v16.4.0 and React Redux v6.
Read more >
fix the upstream dependency conflict or retry material ui
Seems like your dependency tree is either broken or the packages you are trying to install have dependencies on their own that are...
Read more >
React (JavaScript library) - Wikipedia
... so creating React applications usually requires the use of additional libraries for routing, as well as certain client-side functionality.
Read more >
Fix Breaking Changes | Learn React JS with Project in 2 Hours
In this video we will see how to upgrade our existing project to React 18 and fix all the breaking changes. Many of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found