T
TanStack7mo ago
adverse-sapphire

Incorrect routetree.gen.ts structure

Hi all, this is how i've structured my files, i'm expecting that anything beyond /dashboard/* will inherit a navigation that i've created however this is not the case, in routetree.gen it shows that the base / is the parent of these routes why is that? I have an outlet at /index.ts and /dashboard/index.ts
No description
No description
4 Replies
harsh-harlequin
harsh-harlequin7mo ago
/index.tsx is not a parent of /dashboard/index.tsx both are leafs
adverse-sapphire
adverse-sapphireOP7mo ago
hm what about __root? is that where the current parents are pointing to? rootRoute?
harsh-harlequin
harsh-harlequin7mo ago
if you have not defined an explicit route in between, then yes, rootRoute is the parent an explicit route could be e.g.
dashboard.tsx <<< this one
/dashboard/index.tsx
dashboard.tsx <<< this one
/dashboard/index.tsx
adverse-sapphire
adverse-sapphireOP7mo ago
is that done via the
export const Route = createRootRoute({
component: RootComponent,
});
export const Route = createRootRoute({
component: RootComponent,
});
i'm quite new to tanstack router so do you have an example of how to explicity link them? i assumed the file based routing would do it automatically nvm i get what you mean, cheers!

Did you find this page helpful?