You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating routes, flat-routes deviates from Remix's index routing. In Remix, routes/foo/index.tsx has a path of foo, but in flat-routes, it generates a path of foo/. This can cause form libraries to submit to incorrect routes and lead to other bugs in the app.
Input: One file at routes/foo._index.tsx
Expected:
<Routes>
<Routefile="root.tsx">
<Routepath="foo" index file="routes/foo/index.tsx" />
</Route>
</Routes>
Actual:
<Routes>
<Routefile="root.tsx">
<Routepath="foo/" index file="routes/foo._index.tsx" />
</Route>
</Routes>
(note the extra "/" character in the Actual vs. Expected)
With remix-flat-routes you have to explicitly define your index routes.
There's a difference between flat-files and flat-folders. With flat-files the route name is the filename without the extension. With flat-folders the route name is the folder name, and the index.tsx file is the route file. Either way, you must include index (or _index) in the route name to make it an index route.
When generating routes, flat-routes deviates from Remix's index routing. In Remix,
routes/foo/index.tsx
has a path offoo
, but in flat-routes, it generates a path offoo/
. This can cause form libraries to submit to incorrect routes and lead to other bugs in the app.Input: One file at
routes/foo._index.tsx
Expected:
Actual:
(note the extra "/" character in the Actual vs. Expected)
Repro: https://stackblitz.com/edit/node-bszx6t?file=README.md
Workaround: Renaming
foo._index.tsx
tofoo.tsx
generates the expected routes.The text was updated successfully, but these errors were encountered: