-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
"Redirect" doesn't work because of [email protected] #7680
Comments
React Router 5.x isn't compatible with history 5.0.0. This is listed in our dependencies. Simply install a version within the |
@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. See also the related discussion here: remix-run/history#810 |
React Router v6 uses History v5. We already request the correct version in our dependencies for either version of Router. |
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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: