Ed
Hydration error when using useQuery instead of useSuspenseQuery when prefetching
The fix for us to avoid the hydration error was to forcefully set
isPending
to true
on the very first client-side render, which immediately gets reverted to use the one provided from the query.10 replies
Hydration error when using useQuery instead of useSuspenseQuery when prefetching
I think we are having the same problem where we are consuming the pending state in a component that uses a prefetched query. The server renders with the isPending set to true. The client renders only when the data is loaded and therefore isPending is false. We render conditionally depending on this value so causes a hydration error.
10 replies