Performance: Streaming and partial rendering
HIGH IMPACT
This affects how quickly the user sees meaningful content by sending parts of the page as soon as they are ready.
import { Suspense } from 'react'; export default async function Page() { const dataPromise = fetchDataAsync(); return ( <> <Header /> <Suspense fallback={<Loading />}> <MainComponent data={await dataPromise} /> </Suspense> </> ); }
export default function Page() { const data = fetchDataSync(); return <MainComponent data={data} />; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full synchronous render | Single large DOM update | 1 large reflow | High paint cost due to delayed content | [X] Bad |
| Streaming with partial rendering | Multiple smaller DOM updates | Multiple small reflows | Lower paint cost with faster visible content | [OK] Good |