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
The documentation for using the client-side UrqlProvider in Next.js only includes an example with <Suspense />
However, I was surprised to find that when I removed the <Suspense /> it continued to work. Instead of rendering a suspense fallback and (presumably) streaming in the response, it seemed to block on the request to complete SSR.
I could test this by disabling JavaScript on the client side and loading the page. The successfully queried content could be seen rendered in the initial HTML payload.
This seems to behave the same as what's documented for React Query's useSuspenseQuery implementation:
If you call useSuspenseQuery without wrapping it in a boundary, the HTML response won't start until the fetch resolves. This can be what you want depending on the situation, but keep in mind that this will hurt your TTFB.
Is this correct intentional behavior in urql? Because in our case it is actually desirable due to SEO concerns.
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.
-
The documentation for using the client-side
UrqlProviderin Next.js only includes an example with<Suspense />However, I was surprised to find that when I removed the
<Suspense />it continued to work. Instead of rendering a suspense fallback and (presumably) streaming in the response, it seemed to block on the request to complete SSR.I could test this by disabling JavaScript on the client side and loading the page. The successfully queried content could be seen rendered in the initial HTML payload.
This seems to behave the same as what's documented for React Query's
useSuspenseQueryimplementation:Is this correct intentional behavior in
urql? Because in our case it is actually desirable due to SEO concerns.Beta Was this translation helpful? Give feedback.
All reactions