React-router@3 with v7 beta
See original GitHub issueDo you want to request a feature or report a bug?
bug
What is the current behavior?
React router@3 not working.
Looks like that connect
is not behaving the same way as in v6.
React-router@3 is testing React.isValidElement in ReactContext file and this check is returning false.
Maybe the reason is that the connected component is called later than before thus the check call resolves to false always?
How to reproduce:
https://codesandbox.io/s/2v0oy0xwrn
react-redux v6 - Error: Could not find "store" in the context of "Connect(Component)". 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(Component) in connect options.
This error is actually not error, it will work ok after adding provider, etc…
https://codesandbox.io/s/1027585xjl
react-redux v7 - Error: The root route must render a single element
This is react-router error caused by the React.isValidElement call.
What is the expected behavior?
Not returning the error
Which versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux?
React, ReactDOM - 16.8.4 Redux - 4.0.1 React Redux - 7.0.0-beta.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
@Pegase745 The latest version of
react-redux
works fine now with react-router 3.2.3. The “bug” was fixed in react-router. There is no change needed in react-redux. See https://github.com/ReactTraining/react-router/pull/6806 for details.Yes, this is a Router bug. We don’t maintain 3.x any longer, so you’ll need to migrate to 5.0 (which has support for React.memo/React.lazy components).