routeTree.gen.ts setting the wrong parent
hey guys.
I have a file route defined as
and i was expecting
/tree/$treeId
as a parent but in the routeTree.gen.ts
i only have the rootRoute as parent
my goal is to inherit the search params from /tree/$treeId
5 Replies
metropolitan-bronze•13mo ago
please provide a complete minimal example
e.g. by forking one of the existing router examples on stackblitz
harsh-harlequinOP•13mo ago
Sure!
Minimal example -> https://stackblitz.com/edit/tanstack-router-a5btfw?file=src%2Froutes%2Fposts%2Fmypost%2Findex.tsx,src%2FrouteTree.gen.ts,src%2Froutes%2F__root.tsx&preset=node
Here my goal its to make the
routeTree.gen.ts
recognize /posts/
as parent of /mypost/
metropolitan-bronze•13mo ago
then you need to create a route for
/posts/
it's missing
either add /routes/posts.tx
or /routes/posts/route.tx
harsh-harlequinOP•13mo ago
thanks @Manuel Schiller , I thought that
/posts/index
would be my route heremetropolitan-bronze•13mo ago
no, that is the leaf route that will be rendered if you access
/posts
.