Next.js 13.4 app directory prefetch/hydrate questions
Hi Guys, Alka here
Right now i try to build my own personal blogs, preiously i try to make bloglist that has pagination with helps of tanstack query, which right now is working perfectly, but since it became client side components, i have some concen for my blog SEO so i want to use prefetching.
I have a questions for how to hydrate the client side components
here is my layout.tsx
(i attach in the attachement)
here is my BlogList.tsx
(i attach in the attachement)
i also implement the note or issues and its solutions that mentioned in the documentaions
1. providers
2. issues with typescript regarding the Hydrate (i use separate file called HydrateClient.tsx)
3. and use query-core for QueryClient and dehydrate when i import the functions.
i get error from my nextjs.
here is the error
3 Replies
extended-salmonOP•3y ago
im so sorry if my code is very messy, i still learn programming in general.
extended-salmonOP•3y ago
here is the screenshot of my blog page.
it is running on my vps server, hence there is no pagination button yet, i haven't deploy it for now.
it just for illustrations.

extended-salmonOP•3y ago
Hi Guys
I sucessfully isolate the issues, i follow more the guide from https://tanstack.com/query/v4/docs/react/guides/ssr in nextjs 13 section.
so the issues is when i try to hydrate the bloglist
here is the components where i hydrate the bloglist.
but i still facing same issues
SSR | TanStack Query Docs
React Query supports two ways of prefetching data on the server and passing that to the queryClient.
Prefetch the data yourself and pass it in as initialData