Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: v3 incompatibility with React 18 and StrictMode #11372

Closed
maisano-patreon opened this issue Mar 26, 2024 · 3 comments
Closed

[Bug]: v3 incompatibility with React 18 and StrictMode #11372

maisano-patreon opened this issue Mar 26, 2024 · 3 comments
Labels

Comments

@maisano-patreon
Copy link

maisano-patreon commented Mar 26, 2024

What version of React Router are you using?

v3

Steps to Reproduce

<StrictMode>
  <BrowserRouter>
    <Route path="/a" component={A} />
    <Route path="/b" component={B} />
  </BrowserRouter>
</StrictMode>

Load /a, navigate to /b.

Expected Behavior

A is initially rendered, then B is later rendered post navigation.

Actual Behavior

A is initially rendered, then there's no change post navigation.

There's no change due to the transition manager being bound in componentWillMount rather than componentDidMount.

I have a very small patch that resolves this and would allow me to migrate a large codebase heavily coupled to v3 to React 18 without dropping StrictMode. Short of this, I'll likely locally publish an internal fork of v3 with 18 compat. I am well aware that I'm asking to patch a years-old version of this package, but I wanted to check before forking.

@jcabrerazuniga
Copy link

I think I am having this problem. Please see my question at:

https://stackoverflow.com/questions/78258527/react-router-not-routing/78258651#78258651

@zmras
Copy link

zmras commented May 7, 2024

I'm also facing the same issue. And I can't really migrate to newer version because it's a big project using some unavailable features in the newer versions (like onEnter, onLeave). A patch of v3 with react 18 compatibility would be appreciated.

@timdorr
Copy link
Member

timdorr commented May 8, 2024

v3 is no longer supported. It hasn't been substantially worked on in nearly a decade.

@timdorr timdorr closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants