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
ratty-blushOP•12mo ago

ratty-blushOP•12mo 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.solid-orange•12mo 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.

solid-orange•12mo ago
use
to:"."
ratty-blushOP•12mo 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.

ratty-blushOP•12mo ago

ratty-blushOP•12mo 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?
solid-orange•12mo ago
yeah that's outdated
good catch
this sentence should just be deleted
can you provide a PR to the docs?
ratty-blushOP•12mo 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.