How to handle route specificity issues when incrementally adopting framework routing? #12692
Unanswered
vinibanaco
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Migrate highly specific routes first Also you can define those highly specific routes and send them to the non migrated file |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm experimenting the process of incrementally adopting the framework features in a simple app. I followed the guide available in the docs and everything worked out as intended, so now I'm starting to migrate some routes to the new format.
However, I found an issue when migrating a parameterized route to the new format. If there's another route in the catchall that also matches the parameterized route and would normally have higher specificity (like how
/todos/new
is more specific than/todos/:id
), the actual creation page gets unreachable. The details page will be rendered instead.Any ideas on how do I migrate the details page without needing to migrate the creation page first?
I've already tried creating a new
route()
that also renderscatchall.tsx
, but it doesn't work because the path needs to have a trailing "*", meaning the<Routes>
insidecatchall.tsx
receives a relative pathname (it receives "/new" instead of "/todos/new").Beta Was this translation helpful? Give feedback.
All reactions