Typescript on Link component "to" prop go wrong when have nested layout route for File base route
5 Replies
genetic-orange•2y ago
ìd
layout-a is nowhere definednational-goldOP•2y ago
@Manuel Schiller i just fixed the replicate pls check again
genetic-orange•2y ago
looks like there is a bug in the code generator with nested layout routes like
_layout/_layout-2, the second _layout gets stripped away.
if you rename the second level to _xxx, it does not get stripped away:
https://stackblitz.com/edit/tanstack-router-ttys2n?file=src%2FrouteTree.gen.ts,src%2Froutes%2F_layout%2F_xxx2.tsx
can you create a github issue so this can be properly tracked?StackBlitz
Router Basic File Based Example (forked) - StackBlitz
Run official live example code for Router Basic File Based, created by Tanstack on StackBlitz
national-goldOP•2y ago
In Additional, when i change second level to something other than _layout-... it will append the layout folder name to the path while it should not

genetic-orange•2y ago
I have a fix for this issue:
https://github.com/TanStack/router/pull/946
the issues in your example are resolved, can you test this with your real codebase?