Error: No QueryClient set, use QueryClientProvider to set one
Hello!
I have wrapped my _app.tsx properly and I have made useQuery functionality possible, however on this specific component it just won't work.
pages/room/[slug].tsx
:
The error in particular looks like:
https://i.imgur.com/o3C1Zas.png4 Replies
Adding this as a dependency resolved the issue inside package.json:
"@tanstack/react-query": "^4.20.4",
oh my, thank you! this has cost me hours, because google can't reach discord 😅
is this something that is in the docs? that you need to install @tanstack/react-query?
because for me it worked if I first render the page in dev mode, then add the imprort of utils/trpc. but as soon as i refreshed, the whole app crashed
Yes it’s in the install command and documented as an integration with react-query, we don’t ship that library because that would cause problems https://trpc.io/docs/reactjs/setup
Set up the React Query Integration | tRPC
How to use and setup tRPC in React
Yeah, I've seen it now. Thank you. Altough the described behaviour is still strange, since it works until the hard refresh. But I guess that's just some unfortunate edge case.
I've been using the Next.js integration btw.