Can we get a layout file type for file based routing?
It's sort of annoying sometimes where the _layout files and directories aren't sorted cleanly. And overall I find it a little confusing.
Has a
*.layout.tsx
file type ever been considered?
So we can do something like this?

16 Replies
fascinating-indigo•13mo ago
what does "not sorted cleanly" mean for you exactly?
genetic-orangeOP•13mo ago
i.e. the ordering

genetic-orangeOP•13mo ago
I also think its just easier to grok having the layout file inside the directory, everything relevant to the pathless route is in the same place than a lonely file route as a sibling of the pathless directory @Manuel Schiller
fascinating-indigo•13mo ago
you can have the layout file inside the directory
just name it route.tsx (for now that name is hard coded but will be made configurable )
genetic-orangeOP•13mo ago
amazing, thank you
fascinating-indigo•13mo ago
btw this is now configurable, so you can use another name than "route" if you want
absent-sapphire•12mo ago
hey bro, please explain.
So if i have:
Im new, and docs are fuzzy with layouts. Thanks a bunch
fascinating-indigo•12mo ago
yes you could use "layout" instead of "route" if you want to
fascinating-indigo•12mo ago
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

fascinating-indigo•12mo ago

fascinating-indigo•12mo ago
however, I would only recommend doing this if necessary
because now you are diverging from the "standard" conventions and it will be harder for people to understand
absent-sapphire•12mo ago
Is there some sort of config parameter I’m supposed to specify? For some reason I can get route to work but not layout.
fascinating-indigo•12mo ago
yes, the config parameter that I screenshotted above
routeToken
absent-sapphire•12mo ago
routeFilePrefix
Ahh I see thx
fascinating-indigo•12mo ago
no
routeToken
absent-sapphire•12mo ago
Gotchu. Appreciate it