tRPC Query being called client side even with dehydrated state
I have a trpc v10 prefetch in gssp, it's being passed in correctly and hydrated properly, but the query is still being called client side
5 Replies
Can't figure out if this is intentional, but I was under the impression the fetch wouldn't be called client side if it was dehydrated
simple setup
status is never
"loading"
, so it's being passed in correctly
just not sure why it's being called client side as well
unless its some kind of cache validation thingif you're using the default staleTime of zero, that is expected. see: https://tanstack.com/query/v4/docs/guides/ssr#staleness-is-measured-from-when-the-query-was-fetched-on-the-server
SSR | TanStack Query Docs
React Query supports two ways of prefetching data on the server and passing that to the queryClient.
Prefetch the data yourself and pass it in as initialData
Amazing, thank you for finding this!