T
Join ServertRPC
❓-help
Recommended way to prefetch client-side
In react-query, you can do
In trpc, I seem to only have access to the
Is there a way to do
queryClient.prefetchQuery(['todos', input], queryFn)
In trpc, I seem to only have access to the
useQuery
option on my endpoints:trpc.todos.useQuery(input)
Is there a way to do
trpc.todos.prefetchQuery(input)
or similar?See https://trpc.io/docs/v10/invalidateQueries for the react query utils pattern
Our docs on this aren't great right now though
ahhhhh gotcha! I did see useContext kinda worked but couldn't find docs on it. thank you!