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.

React-router@3 with v7 beta

See original GitHub issue

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

github_iconTop GitHub Comments

11reactions
dlong500commented, Jul 10, 2019

@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.

7reactions
timdorrcommented, Mar 22, 2019

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Router: Home v6.6.1
Start with the tutorial. It will quickly introduce you to the primary features of React Router: from configuring routes, to loading and mutating...
Read more >
react-router-3
A complete routing library for React. Latest version: 3.2.2, last published: 5 years ago. Start using react-router-3 in your project by ...
Read more >
A guide to using React Router v6 in React apps
React Router v6 is still in beta. This tutorial is going to give you a peek into some of the new features the...
Read more >
react-router-dom@4.4.0-beta.7 vulnerabilities
Learn more about react-router-dom@4.4.0-beta.7 vulnerabilities. react-router-dom@4.4.0-beta.7 ... fbjs@0.8.18 › isomorphic-fetch@2.2.1 › node-fetch@1.7.3.
Read more >
react-router-v6-beta.3
Sign up for free to save your work0/3 Sandboxes used - Anonymous. CodeSandbox. react-router-v6-beta.3. 0. Embed Fork Create Sandbox Sign in. Sandbox Info....
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