T
TanStack9mo ago
sensitive-blue

advice on filesystem routing

is there a way to achieve this posts structure from the docs without having both a directory named posts and a posts.tsx ideally I could have something like posts/ with a layout.tsx and then also index.tsx and $postId.tsx. not having everything post-related contained within the posts directory itslef feels confusing to me.
No description
2 Replies
afraid-scarlet
afraid-scarlet9mo ago
instead of
posts.tsx
posts/
index.tsx
$postId.tsx
posts.tsx
posts/
index.tsx
$postId.tsx
you can have
posts/
route.tsx // <<<< this is the "route" token (can be changed via config)
index.tsx
$postId.tsx
posts/
route.tsx // <<<< this is the "route" token (can be changed via config)
index.tsx
$postId.tsx
sensitive-blue
sensitive-blueOP9mo ago
oh thats exactly what i wanted, thank you!

Did you find this page helpful?