You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
https://tanstack.com/router/latest/docs/framework/react/examples/with-trpc-react-query?path=examples%2Freact%2Fwith-trpc-react-query%2Fsrc%2Froutes%2Fdashboard.index.tsx
In this example
trpc
is imported to be used withuseQuery(trpc...)
But in the loader it's being grabbed from the router context.
My question: Why send tRPC though router context? Why not just always use it via import?
I tried it on my local and both ways seem to work the same? Unless I'm missing something.
Why use context at all? If we can just import both
trpc
andqueryClient
fromrouter.tsx
Beta Was this translation helpful? Give feedback.
All reactions