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
Simulate navigation to protected route. Just navigate to / route.
Expected Behavior
Because you are not logged in, app should redirect you to /login page.
Actual Behavior
URL is changing but component did not mounting.
Comments
history package recently released a major version - v5.0.0.
Redirect doesn't work because of it. I also describe issue on history repository.
There can also be some changes what breaks react-router .
I use Router with history instead of BrowserRouter with useHistory hook, because I need often access to history from outside of react components.
It would be great if in the future react-router will get me this feature without using history package :)
The text was updated successfully, but these errors were encountered:
@timdorr Since you ("you" as in ReactTraining) maintain both of these dependencies, are there plans to address this? Staying on an outdated dependency long-term is not a good solution for many developers/companies.
Version
Test Case
https://codesandbox.io/s/react-router-redirect-issue-ugs02
Steps to reproduce
Simulate navigation to protected route. Just navigate to
/
route.Expected Behavior
Because you are not logged in, app should redirect you to
/login
page.Actual Behavior
URL is changing but component did not mounting.
Comments
history
package recently released a major version -v5.0.0
.Redirect doesn't work because of it. I also describe issue on history repository.
There can also be some changes what breaks
react-router
.I use
Router
withhistory
instead ofBrowserRouter
withuseHistory
hook, because I need often access to history from outside of react components.It would be great if in the future
react-router
will get me this feature without using history package :)The text was updated successfully, but these errors were encountered: