Reputation: 13
I need implement route with name: /someroute-1
, /someroute-2
... and so on.
With dynamic part after "-"
For example: app/routes/someroute-$id
p.s: NOT app/routes/someroute/$id
I tried app/routes/someroute-$id
, it is doesn't work
Upvotes: 0
Views: 82
Reputation: 20322
No. In React Router 6 (and Remix), dynamic params must be the entire URL segment (the part between the /
).
You have to do something like app/routes/$someroute
, and in your loader, parse params.someroute
to extract the id.
Upvotes: 0