Streaming with Suspense
Parts of the UI load immediately while slower parts stream in later. Instead of blocking the whole page, Suspense shows a fallback at once and swaps in the slow content when it's ready.
Expected behaviour
The heading and layout appear instantly.
SlowComponent deliberately waits 3 seconds, so the fallback (“Loading slow content…”) shows first, then the slow component streams into the page and replaces it.How this page works
- 1The page renders immediately with its static content.
- 2Suspense sees that
SlowComponentisn't ready yet. - 3The fallback is shown straight away.
- 4When the slow component resolves, it streams into the page.
- 5No full-page reload or blocking at any point.
Live result
Loading slow content…