-
Notifications
You must be signed in to change notification settings - Fork 31
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
Prevent endless redirect #82
Comments
Any suggestion to solve this? I don't want to rise a timer for each redirect action. |
Can you check if the to-be-redirected URL exactly matches the current URL (including hash, query and everything)? I doubt anyone wants to have the exact same URL twice in the history stack. |
How to detect this case?
|
I think as a first step checking |
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was just typing
<Route path="/" redirect="/">
in REPL (for #81) and it froze my tab. I assume because of an endless redirect (my cursor was in theredirect
prop and I was about to type there).To reproduce open REPL and paste
<Route path="/" redirect="/" />
It should detect that edge case and not run into an endless loop. Mistakes happen and if
path
orredirect
are dynamic this would lock up an app.Maybe add a
console.error
for this case in dev modeThe text was updated successfully, but these errors were encountered: