-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
react-router-config does not match on later paths even if there is an exact path match later #5429
Comments
This does appear to be a bug in rrc. We're not doing any testing of that form of routes, so the first step would be to add a failing test. Then we can go about fixing for it. Edit: Why are people thumbs-downing me? 😭 |
@timdorr If you are saying this is a bug, that means Please advise. I can see if I can help contribute to fixing this bug but need more info. Thanks |
You can workaround this... set flag (variable) as UnauthorizedLayout/someAuthorizedLayout into routes config. Then use matchRoutes, to find matched route, check flag, then do redirect with some status if fail, or just render if it success )... here is example:
|
I believe |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Version
4.1.1
Test Case
None
Steps to reproduce
Create a react-router-config that has the following:
Try to go to '/' and you are unable to. Why? Because the route matches the first route and "consumes" the request before it realizes that there is a '/' exact match
Expected Behavior
I expect it to go to the Login page.
Actual Behavior
It goes to no route because it traverses the routes tree and when it hits someAuthorizedLayout it finds no nested routes that match.
Is this a bug? or is this by design?
The text was updated successfully, but these errors were encountered: