T
TanStack4y ago
like-gold

React Query with Next 13

Hi, is there any guide to implement RQ with Next 13? Thanks
6 Replies
typical-coral
typical-coral4y ago
Dominik 🇺🇦 (@TkDodo)
Not gonna lie that (as a maintainer of a library in the data fetching space) I'm feeling mostly afraid of server components and suspense. "How will this work with react-query" is a good question. It feels like I'm supposed to have an answer but I don't. Huge imposter syndrome rn
Likes
322
Twitter
conscious-sapphire
conscious-sapphire4y ago
Is there a current discussion on the discord? If not could we use this thread?
typical-coral
typical-coral4y ago
you didn't look very hard: #query-next-13
conscious-sapphire
conscious-sapphire4y ago
pretty easy to miss when the UI looks like below. figured it would be a thread in the react channel. hopefully others are able to find it through this thread as well.
No description
like-gold
like-goldOP4y ago
You are doing amazing work mate. I am sure you will figure it out and we as a community can help.
equal-aqua
equal-aqua4y ago
This is how I managed to setup RQ in Next 13: https://twitter.com/lukemorales/status/1585506850421854210
Luke Morales (@lukemorales)
@TkDodo @diegohaz Example to how setup React Query in the new router: Separated file to declare client-side providers (not possible to instantiate QueryClient on a file that is not using the 'use client' indicative, since files will run on the server first and createContext is client-side only)
From Luke Morales (@lukemorales)
Twitter

Did you find this page helpful?