ForkMeDaddy
ForkMeDaddy12mo ago

Typescript Question

I try a simple Query SSR. I would have expected to have direct access to the properties on the userSSR object. Instead there is this valueJSON stuff. What am I missing?
No description
No description
3 Replies
ballingt
ballingt12mo ago
Se the docs here: https://docs.convex.dev/client/react/nextjs/server-rendering#preloading-data-for-client-components You can use preloadedQueryResult() to get the data here
ForkMeDaddy
ForkMeDaddyOP12mo ago
ahh no it's fetchQuery Server component
ballingt
ballingt12mo ago
If you just want a SSR query without preloading for the client then you may want fetchQuery() instead preloadQuery is for preloading a query in a server component and then using that preloaded query in a client component.

Did you find this page helpful?