T
TanStack4y ago
stuck-chocolate

Typescript error when extracting param matches when param is on the root route

I see Property 'accountId' does not exist on type 'Record<never, string> when using this param on the root route. I might just be using it wrong though. The param does exist at runtime, so it is found correctly. Here's the stackblitz https://stackblitz.com/edit/tanstack-router-mkgsih?file=src/main.tsx
Router Basic Example (forked) - StackBlitz
Run official live example code for Router Basic, created by Tanstack on StackBlitz
2 Replies
stuck-chocolate
stuck-chocolateOP4y ago
ah, it's this https://github.com/TanStack/router/issues/365 which was posted in the last day as well.
GitHub
Nested params typescript · Issue #365 · TanStack/router
Describe the bug All working very nice when params are at last place and typescript not complain. const { navigate, search: { musicView }, } = router.useMatch(&#39;/admin/music/list&#39;); ...
afraid-scarlet
afraid-scarlet4y ago
Should be fixed now!

Did you find this page helpful?