How to get preloaded data on the server
Hi Guys, I am back with another question.
This is related to Preloading Data https://docs.convex.dev/api/modules/nextjs#preloading-data
I followed it, it's working. however I am not sure if its working as its supposed to be.
In my next js app, layout.ts file, I call
preloadQuery
to load the query
In the same file, I am using ChildComponent and passing the preloaded
query to it and in the Child Component (client component) I am calling usePreloadedQuery
and it works**.
The issue is when I console log the preloaded
query in server component (layout.ts file) it just displays
Is this how its supposed to work or am I missing something? I don't see any actuald data here.
FYI: The query is called outside the ConvexProviderWithClerk
Module: nextjs | Convex Developer Hub
Helpers for integrating Convex into Next.js applications using server rendering.
1 Reply
Next.js Server Rendering | Convex Developer Hub
Next.js automatically renders both Client and Server Components on the server