Performance: Streaming with Suspense
HIGH IMPACT
Streaming with Suspense improves page load speed by sending HTML chunks progressively, reducing time to first meaningful paint.
import { Suspense } from 'react'; export default function Page() { return ( <Suspense fallback={<Loading />}> <AsyncComponent /> </Suspense> ); }
export default function Page() { const data = fetchDataSync(); return <MainComponent data={data} />; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous full render | Single large DOM update | 1 large reflow | High paint cost | [X] Bad |
| Streaming with Suspense | Multiple small DOM updates | Multiple small reflows | Lower paint cost | [OK] Good |