useSearch and conetext are not typed it search types as any and context to {}
My main.tsx
and index.tsx
order and sortBy types as any
context typed as {}
What I'm doing wrong ?
NOTE: this is a react vite project and I manually added tanstack-router and tanstack-query
6 Replies
genetic-orangeOP•8mo ago
GitHub
GitHub - inam95/tanstack-playground
Contribute to inam95/tanstack-playground development by creating an account on GitHub.
mere-teal•8mo ago
a few things
latest zod does not not need the
zodSearchValidator
anymore.
also, please use @tanstack/zod-adapter instead
genetic-orangeOP•8mo ago
Okay but is that the case why i don't get the type safey for search and context ?
sensitive-blue•8mo ago
You also need to use
createRootRouteWithContext
in __root.tsx
https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunctiongenetic-orangeOP•8mo ago
got it thanks
ambitious-aqua•8mo ago
Thanks, this was very helpful