Does type interference work on navigate({search})
I am having little trouble with type interference with search and
navigate. I took the example from https://tanstack.com/router/v1/docs/framework/react/guide/search-params#usenavigate-navigate-search-
Search Params | TanStack Router Docs
Similar to how TanStack Query made handling server-state in your React applications a breeze, TanStack Router aims to unlock the power of URL search params in your applications.
Why not just use URLSearchParams?

5 Replies
equal-aquaOP•2y ago
So currently it doesnt seem to interfer the correct types on navigate
search. I use exercise.tsx and exercise.lazy.tsx file route approach, not sure if it has to do with thisvicious-gold•2y ago
Could you add the
from proprty onto the useNavigate hook?
This would narrow the types.equal-aquaOP•2y ago
I will try, but from is actually diffictult in this case as there are multiple locations possible as
fromforeign-sapphire•2y ago
you can supply a string union as
from:
equal-aquaOP•2y ago
This works very well: