-
Was just wondering how streaming worked in rakkas and if it works when you wrap a component in client suspense or is automatically taken care of |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's automatically taken care of. Rakkas wraps your entire app in Suspense (with an empty fallback) but you can add further Suspense boundaries for more granular loading state. React will then render the fallback and replace it with the actual content once it's ready. Note that streaming is disabled under certain circumstances:
If it's disabled, Rakkas will wait for the whole page to render before sending the HTML. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the informative answer |
Beta Was this translation helpful? Give feedback.
It's automatically taken care of.
Rakkas wraps your entire app in Suspense (with an empty fallback) but you can add further Suspense boundaries for more granular loading state. React will then render the fallback and replace it with the actual content once it's ready.
Note that streaming is disabled under certain circumstances:
throttleRenderStream
to true in aheaders
function) e.g. if you want to use a lib that doesn't support streaming like Styled Components.If …