How to get path param type from parent path on parseParams
Hi Everyone,
I recently started using file based routing and ran into this situation. I have a URL schema like this:
posts/:userId/posts
posts/:userId/liked
Where posts and liked are tabs. My folder structure looks something like this:
/posts
$userId/
_tab_layout/
posts.index.tsx
liked.index.tsx
_tab_layout.tsx
Inside both liked.index.tsx and posts.index.tsx I am utilizing the userId path param through parseParams, however the type definition for params comes out as Record<never, string>. How can I get the correct type definition from the parent $userId path, so I can pass it to the loaders of the respective routes?
Thank you in advance. Also any advice on how to better structure this would be really appreciated!
1 Reply
modern-teal•2y ago
can you please provide a minimal example on Stackblitz?