You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm trying to replicate an example from the docs (added here).
It seems like I'm missing the point, but what's happening in the example is:
SSR / loader:
kick off the slow query and ignore the result
kick off the fast query and wait the result
SSR / router:
dehydrate the queryClient (consists only of await fast query data) to the TSR inline data
CSR / router:
hydrate the dehydratedState to local queryClient (with fast query only)
CSR / component:
fast query renders in success state as it exists in the query cache
slow query renders in pending state (aka fallback in Suspense) as it does not exist in the query cache
slow query runs queryFn again (it was already run SSR in SSR / loader section), gets the data, renders success state
In this case server never inlines the slow data retrieved later, it is basically ignored.
It seems like we need to return Promise from the loader to make it work as well asuse the promise on CSR until it is resolved to make use of inline data.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to replicate an example from the docs (added here).
It seems like I'm missing the point, but what's happening in the example is:
SSR / loader:
SSR / router:
queryClient
(consists only of await fast query data) to the TSR inline dataCSR / router:
dehydratedState
to localqueryClient
(with fast query only)CSR / component:
success
state as it exists in the query cachepending
state (akafallback
in Suspense) as it does not exist in the query cachequeryFn
again (it was already run SSR inSSR / loader
section), gets the data, renderssuccess
stateIn this case server never inlines the slow data retrieved later, it is basically ignored.
It seems like we need to return
Promise
from theloader
to make it work as well asuse
the promise on CSR until it is resolved to make use of inline data.Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions