TanStackT
TanStack16mo ago
29 replies
skinny-azure

File-based directory routes not working

Hi, I'm trying to set up a sample project similar to the layout in this example:
https://tanstack.com/router/latest/docs/framework/react/guide/file-based-routing#mixed-flat-and-directory-routes

So I have a posts directory with:
- $postId.tsx
- $postId.edit.tsx

I'm able to navigate to
/posts/1
just fine. But if I go to /posts/1/edit it will go to $postId.tsx instead of $postId.edit.tsx. If I move $postId.edit.tsx up and rename it to posts_.$postId.edit.tsx it works, but I want to keep things organized like they are in the docs. Any ideas?
Was this page helpful?