Don't match routes that have no element/Component and have children #10644
corymharper
started this conversation in
Proposals
Replies: 1 comment
-
This would make life so much easier for abstractions that generate a route tree. I'm using Vite's |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In reading #10635 (comment) I came to understand that this was a design choice for the project, and not a bug. My proposal here is that if a route with children and no element/Component exists, it should not create a matching route at its index that would display nothing. It should only match in the case that a
<Route index />
is defined for that parent route as a child route. This accomplishes two different things in my mind:I can't speak for others, but I primarily use nested routes to group "associated" routes in my application, and to make the best use of relative routes in navigation. The current behavior has caused me to define extra "not found" routes throughout my nested routes to avoid this behavior, and that was only after realizing that these routes would be matched when I hadn't even thought I "defined" them.
Beta Was this translation helpful? Give feedback.
All reactions