Simplifying SSR (e.g. in Next.JS)
I'm just trying to figure out if I'm missing something or if somebody else already tries this but:
Wouldn't it be theoretically possible, for SSR, to detect when a
useQuery
is being SSR (e.g. checking typeof window === 'undefined'
) and therefore await
the fetch call automatically and then pass it to initialData
to rehydrate on the client?1 Reply
Just to be clear I'm not complaining that this hasn't happened yet. I'm just trying to understand why this isn't the best solution.