Replies: 1 comment
-
This is super cool! Though it would probably make for a better issue on TanStack router and with the intention to make an example that demonstrates how cool this is! |
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.
-
routeTree
is an auto generated variable that holds all of your site navigation paths in it.So it would make sense to be able to use that variable to loop over those paths to generate website navigation menus.
There are multiple problems making this a more painful task than it needs to be.
routeTree.children
types are incorrect (Incorrect type onrouteTree.children
router#4766)routeTree.children
doesn't have a nested style structure of children having children, all of the paths are at the top level attached to the route, so this makes managing multi-level navigation more difficult.createFileRoute
function. This means that we have to manually create an object matching up paths to the nav label.This was my attempt at building a nav using
routeTree.children
.I think the least disruptive fix would be to create a
useRouteNavigation()
hook for getting the navigation in a nested format and properties need to be added to thecreateFileRoute
function to definenavLabel
andnavOrder
.Beta Was this translation helpful? Give feedback.
All reactions