Skip to content

Commit

Permalink
Create famous-papayas-lie.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored Jan 24, 2023
1 parent c5a4cfb commit 50e9842
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .changeset/famous-papayas-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"remix": patch
"@remix-run/dev": patch
---

flat route fixes and enhancements

`app._index.tsx` and `app/index.tsx` are different routes. The first is an index route for the second, and will be rendered into the parent outlet. The second is the parent route itself.

`index.tsx` no longer has any semantic meaning for "index routes", but rather the node module resolution convention of "index modules".

`routes/app.tsx` and `routes/app/index.tsx` *are the same route*. You just moved it to a folder and made an `index.tsx` because that's how node module resolution looks for the module at `routes/app`.

If you want an index route, you use `_index`

| file name | route path | layout |
|-------|-----------|--------|
| `routes/index.tsx` | `/index` | root |
| `routes/_index.tsx` | `/` | root |
| `routes/app.tsx` | `/app` | root |
| `routes/app/index.tsx` | same route as above | root |
| `routes/app._index.tsx` | `/app` | `routes/app.tsx` or `routes/app/index.tsx` |
| `routes/app._index/index.tsx` | same route as above | `routes/app.tsx` or `routes/app/index.tsx` |

0 comments on commit 50e9842

Please sign in to comment.