Using React Suspense
#
How to enable itOne of the goals of GQless is to embrace React Suspense & Concurrent Mode, however these features are still in development by the React team.
Until these features become widespread enough, you will need to opt-in for Suspense support via configuration. This can be done directly in hook, or via the defaults of the client.
#
Usage without SuspenseAll hooks return a $state
object, when suspense support is not enabled.
#
Suspense & SSRReact doesn't yet support suspense whilst rendering on the server, so react-ssr-prepass is used in our SSR functions:
And for that, reason we suggest using a slighty modified Suspense
component:
And everything should work as you might expect.