[Help wanted] Nested routes
Looking to setup a few routes which share the same first param, is this possible?
Somethig like..
/clients/$clientId.tsx
/cilents/$clientId.edit.tsx
When trying this above, my edit route kept rendering the $clientId.tsx. Only way I could get this to work was changing to $clientId.view.tsx and $clientId.edit.tsx.
8 Replies
rare-sapphire•2mo ago
It is possible. Move your current /clients/$clientId.tsx to /clients/$clientId.index.tsx
conscious-sapphireOP•2mo ago
Ahhh, IDK why I didn't thinkk of using index.
Tyvm
yappiest-sapphire•2mo ago
make sure to render an Outlet in the parent route
conscious-sapphireOP•2mo ago
Changing to .index.tsx pattern worked immediately 🙂
yappiest-sapphire•2mo ago
its not the same though
its not nested
conscious-sapphireOP•2mo ago
ooh, maybe I used the wrong terminology - what's a nested route then??
yappiest-sapphire•2mo ago
nested means: when you are
$clientId.edit then edit is rendered insided $clientIdconscious-sapphireOP•2mo ago
Ahhh, apologies - I'm tracking now! Appreciate you