Progressive loading with Suspense boundaries that streams content as it becomes available. Perfect for Dashboards, Real-time applications, and Progressive apps where users benefit from seeing content incrementally.
Streaming uses Suspense boundaries with async Server Components. Cannot use hooks in Suspense boundaries.
import { Suspense } from "react";
export default async function StreamingPage() {
return (
<div>
<Suspense fallback={<div>Loading...</div>}>
<AsyncComponent />
</Suspense>
</div>
);
}
async function AsyncComponent() {
const res = await fetch("https://api.example.com/data");
const data = await res.json();
return <div>{data.message}</div>;
}