Will remix support config-based routing, like useRoutes from react-router? #4288
joeprivettsmart
started this conversation in
General
Replies: 2 comments 2 replies
-
Remix already supports that using the routes function in the remix.config.js https://remix.run/docs/en/v1/api/conventions#routes |
Beta Was this translation helpful? Give feedback.
0 replies
-
In some cases you might want use a ternary to decided what to render, or introduce a redirect based on some business logic. I can't see how this can be done with the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm struggling with the logic behind using the file system and naming these files in certain ways to setup your routes. This seems like an anti-pattern as you want your folder structure to be organised into domains that teams can take ownership of and that doesn't necessarily follow the way it will look like in the URL and hence how you set-up your folder/file structure. Appreciate that Remix is providing what feels like escape hatches to get round this, but it feels completely wrong to be using the file-system to define routes.
The
useRoutes
config-based routing seems way more intuitive. for example here:https://ui.dev/react-router-route-config
Will Remix support config-based routing?
Beta Was this translation helpful? Give feedback.
All reactions