Which project does this relate to?#
Router
Describe the bug#
I made a link component using ValidateLinkOptions as explained in the docs. The component works fine if I pass search to link options as an object, but if search is a setter function, I get:
Type '{ test: string; }' is not assignable to type 'never'.
Your Example Website or App#
https://stackblitz.com/edit/tanstack-router-oeezf1an?file=src%2Froutes%2Fabout.tsx
Steps to Reproduce the Bug or Issue#
Open the link and navigate to src/routes/about.tsx. Notice the two heading components, the one with the functional search setter has a type error.
Expected behavior#
There should be no type error
Screenshots or Videos#
No response
Platform#
- OS: macOS
- Browser: Chrome
Additional context#
No response
Still haven't found the cause exactly, but if anyone is looking for a workaround, explicitly annotating the
prevtype is typesafe and fixes the issue.