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.tsxRouter Basic Example (forked) - StackBlitz
Run official live example code for Router Basic, created by Tanstack on StackBlitz
2 Replies
stuck-chocolateOP•4y 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('/admin/music/list'); ...
afraid-scarlet•4y ago
Should be fixed now!