Theo's Typesafe CultTTC
Theo's Typesafe Cult16mo ago
11 replies
Mainak

useQuery vs useSuspenseQuery

I'm having a hard time understanding in what's the main difference between useQuery and
useSuspenseQuery
? For example I prefetch one endpoint at page.tsx, considering that prefetch will prefill the cache then what will happen if I call useQuery instead on
useSuspenseQuery
?

Also if a component is using
useSuspenseQuery
for some data, then how to invalidate that and fetch new data from some other component? With useQuery we do have invalidate function that I can call!
Was this page helpful?