-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(remix-dev): flat route fixes and enhancements (#5228)
Signed-off-by: Logan McAnsh <logan@mcan.sh>
- Loading branch information
Showing
3 changed files
with
180 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.