Streaming with Suspense
This page demonstrates React Suspense streaming, a feature that allows parts of the UI to load immediately while slower components stream in later. Instead of blocking the entire page until everything is ready, Suspense shows a fallback instantly and then replaces it once the slow content has finished rendering. This creates a smoother, more responsive user experience, especially when loading data or running expensive server components.
Expected Behaviour
When you visit this page, the heading and layout appear instantly. TheSlowComponent intentionally delays for a few seconds, so the Suspense fallback text (“Loading slow content…”) is shown first. Once the slow component finishes rendering, it streams into the page and replaces the fallback automatically.
How This Page Works
- The page renders immediately with visible static content.
- Suspense detects that
SlowComponentis not ready yet. - The fallback text is displayed instantly.
- Once the slow component resolves, it streams into the UI.
- No full-page reload or blocking occurs at any point.
Loading slow content…