If no "to" prop is present navigate({search}) results typescript error
I have a new typescript issue since latest release. I use very often
this results in a typescript issue

9 Replies
helpful-purpleOP•15mo ago

helpful-purpleOP•15mo ago
when I provide either
to:"" or to:"." the type error disappears. What is recommended? Its a search which is across multiple routes so I would like to keep it loose.correct-apricot•15mo ago
see https://tanstack.com/router/latest/docs/framework/react/guide/search-params#writing-search-params
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

correct-apricot•15mo ago
use
to:"."helpful-purpleOP•15mo ago
I think why I got confused is this section inside the docs:
https://tanstack.com/router/latest/docs/framework/react/guide/navigation#search-param-links
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.

helpful-purpleOP•15mo ago

helpful-purpleOP•15mo ago
the docs states that you dont need to supply a to prop. this lead me to omit the to everywhere, now I went through the appearances and added to=".". This might be an old example hint?
correct-apricot•15mo ago
yeah that's outdated
good catch
this sentence should just be deleted
can you provide a PR to the docs?
helpful-purpleOP•15mo ago
sure here you go: https://github.com/TanStack/router/pull/2455
GitHub
fix outdated navigation hint inside the docs by dohomi · Pull Reque...
remove outdated hint for omitting to prop.
