You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: mount happens twice when you navigate forward to a route. Tested with both Google Chrome and Firefox.
To replicate problem:
Click the "Change" button to route from / to /test
Click the browser back button to route from /test to /
Click the browser forward button to route from / to /test
Observe in the console that the first time you went to /test, "Mount" was printed once. The second time using the browser forward button "Mount" was printed twice.
Compiled using webpack, when I ran using vite I could not replicate this issue. Please let me know if it would be useful to crosspost this to the webpack team.
There is no React.StrictMode
When I remove the div above Routes I get this error: Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
Versions:
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.1",
"webpack": "^5.94.0",
Expected Behavior
The component is only mounted once both times you navigate to /test
Actual Behavior
The text was updated successfully, but these errors were encountered:
Hi, I mentioned it above, but I removed <React.StrictMode> and the issue still happens. This is also reproducible with production builds. If it were caused by <React.StrictMode>, I would expect it to happen the first time the /test route loads, but it only happens once you navigate forward.
I may be misunderstanding of how <React.StrictMode> works. Sorry if that's the case.
What version of React Router are you using?
6.26.1
Steps to Reproduce
Problem: mount happens twice when you navigate forward to a route. Tested with both Google Chrome and Firefox.
To replicate problem:
Other Details:
Versions:
Expected Behavior
The component is only mounted once both times you navigate to /test
Actual Behavior
The text was updated successfully, but these errors were encountered: