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
Click on the "New Route" button to navigate to "/new-route".
On the "/new-route" page, attempt to navigate back to the home route by clicking the "Go Back" button.
The navigation back to the home route occurs, but the state passed during the navigation is not accessible in the home route.
Expected Behavior
Upon clicking the "Go Back" button, the application should navigate back to the home route, and the state passed during the navigation should be accessible in the home (redirected) route.
Actual Behavior
The navigation back to the home route occurs, but the state passed during the navigation is not accessible in the home route.
navigate(-1, { state: { message: 'message from new route' } }) //the message does not carry over to the redirected route.
The text was updated successfully, but these errors were encountered:
This is expected behavior. The previous location is immutable. You cannot modify it by adding new state when navigating backwards. If you need to add state, you have a new location and need to navigate forwards. This is the same behavior as the native back() function.
What version of React Router are you using?
"^6.14.2"
Steps to Reproduce
Expected Behavior
Upon clicking the "Go Back" button, the application should navigate back to the home route, and the state passed during the navigation should be accessible in the home (redirected) route.
Actual Behavior
The navigation back to the home route occurs, but the state passed during the navigation is not accessible in the home route.
navigate(-1, { state: { message: 'message from new route' } }) //the message does not carry over to the redirected route.
The text was updated successfully, but these errors were encountered: