Skip to content

_route vs route breaks layout #127

Answered by kiliman
akomm asked this question in Q&A
May 28, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hmm.. interesting. With remix-flat-routes and the flat-folders convention (colocation), these are all synonmous: any file named index, route, layout, page or any file starting with _.

So _user/_route should be treated as a parent layout for _user.stuff/_route. If not, then that is a bug.

Remember, _layout only has a special meaning with hybrid routes in flat-files convention. Typically, you'd have _user.tsx and _user.stuff.tsx. If you want to user hybrid routes it would be _user+/_layout.tsx and _user+/stuff.tsx. Essentially, _user+/_layout.tsx is equivalent to _user.tsx

Thanks again for these examples. It would help greatly if you could include your folder structure: tree app/routes and …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@kiliman
Comment options

Answer selected by akomm
@akomm
Comment options

@kiliman
Comment options

@akomm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants