Skip to content

_app/index.tsx has "/index" route #37

Answered by kiliman
wonu asked this question in Q&A
Discussion options

You must be logged in to vote

I believe there's a bug in the Remix v2 routing.

remix-flat-routes treats this correctly.

_app/index.tsx is the layout route for _app (flat-folder) same as _app.tsx
_app/_index/index.tsx is the index route ... same as app._index.tsx

If you use folders for organization, remix-flat-routes will assume you're using flat-folders, so it looks for the route file from the immediate children. In v2 convention, this can only be index.tsx or route.tsx. With remix-flat-routes, I've extended it so it can index|page|route|layout or any (tsx/jsx/mdx) file starting with a leading _.

For index routes, v2 convention requires it to be named _index. An index route is the default route for a given path, like /

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wonu
Comment options

@kiliman
Comment options

@wonu
Comment options

Answer selected by wonu
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