Replies: 1 comment
-
The type safety requires it. I wish it didn’t, but it’s currently a limitation of the compiler that isn’t going away any time soon. The route tree hierarchy is the one that matters for both runtime and the resulting router type. gerParentRoute is a type-only getter that enables child routes to be aware of and use their parent and grandparent routes types. They are both required to achieve the level of type safety the library exhibits :) |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
The current API requires duplicating hierarchy information in multiple spots (when constructing the route tree, and on the route itself via the
getParentRoute
property).What happens if these don't match up? Take the example below, where the
postsIndexRoute
parent is set topostsRoute
, but that hierarchy is not reflected in therouteTree
.posts-home.tsx
router.tsx
Is this API required to support typings, or for some other reason? Will it work with nested lazy loaded routes?
Curious, because in my (very subjective :)) opinion, the config APIs in react-router and solid-router:
Beta Was this translation helpful? Give feedback.
All reactions