NextJs 13 server components with ReactQuery
The react-query has been a smooth experience when I used to work on reactJs.
In nextJs13 (appdir) especially for server components, I have seen many work around for its implementation like hydrations and some other methods. But it is still not a pleasant experience.
Wondering whether React-Query would be able to achieve the similar smooth experience as before ever, or should I hope more for useHooks to also come to server components;.
2 Replies
sensitive-blue•3y ago
what do you mean? Hydration was always needed in getServerSideProps before. It's not a workaround
sensitive-blue•3y ago
Dominik (@TkDodo)
📢 Yesterday, we released an experimental react-query-nextjs package for the app directory. Wrap your app in the <ReactQueryStreamedHydration> component to enjoy direct useQuery fetches on the server with suspense, which streams to the client 🎉
Example: https://t.co/6OspySSzEY
Likes
1173
Retweets
172
Twitter