RayyR
Convex Community2y ago
2 replies
Rayy

What is the difference between preloading query vs fetching queries in server components?

I have a parent component in Next JS which is a server component, that is rendering two children components both of which are client components. I need to access the query in both the client components.
After going through the docs, I can see there are two approaches to get this done.

1. Preloading the query and then accessing the preloaded query in the client componens.
2. fetching the query using
fetchQuery
in server component and passing the data to the client components.

Also, will preloading the query and then accessing it using usePreloadedQuery call the query twice?

What does it mean when it says that it will not be reactive when using
fetchQuery
?
Was this page helpful?