What if I want a layout route named “`index`”?
If the file
posts.index.tsx has been made to mean /posts/ and not /posts/index then how can layout route /posts/index be accomplished? Can this be done without changing the indexToken config option away from “index”?
* posts.index.tsx -> /posts/
* posts.[index].tsx -> /posts/[index]
* posts.index.route.tsx -> /posts/
* posts.index.index.tsx -> /posts/index/
* posts.index.index.route.tsx -> /posts/index/
* ??? -> /posts/index ?10 Replies
fair-rose•4mo ago
did escaping with
[]not work?other-emeraldOP•4mo ago
The
[] escaping seems to only be for escaping dots? I also don’t really like how the dot is representing a file path separator (looks like multiple extensions) in supporting flat file structures. I’m only a few pages into TSR, and it’s already triggering my OCD.fair-rose•4mo ago
then dont use the dot?
and use nested files / folders
The [] escaping seems to only be for escaping dots?did you try it?
other-emeraldOP•4mo ago
posts[.]index.tsx gives /posts.index
If that's what you mean to try?fair-rose•4mo ago
no i meant [index].tsx
but doesnt seem to work
other-emeraldOP•4mo ago
It looks like
[] escaping is ignored for anything that isn’t a single character:
water.tsx -> /water
wa[t]er.tsx -> /water
wa[te]r.tsx -> /wa[te]r
wa[]ter.tsx -> /wa[]terfair-rose•4mo ago
so yes in fact the escaping does not work to escape against index being treated as index
i am not sure if we want to support that, but can you please create a github issue for this including a forked stackblitz example?
other-emeraldOP•4mo ago
Okay
fair-rose•4mo ago
have a fix for the single char escaping lined up
but this does not affect index being treated as literal "index"
other-emeraldOP•4mo ago
GitHub
Creating a layout route named “
index” is not supported by fil...Which project does this relate to? Router Describe the bug According to the file-based routing rules, a file named posts.index.tsx means /posts/ and not /posts/index. So then how can layout route /...