sh03
sh033w ago

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
sh03
sh03OP3w ago
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.

Did you find this page helpful?