Suspense boundary placement
What you need to know
Suspense divides an interface into regions that can become ready separately. Place a boundary near the asynchronous component whose temporary absence is acceptable. On a bookstore page, visitors can read the title immediately while a separate recommendations area is still preparing.
By the end, you can: choose a boundary around slow data; keep independent content visible.
app/discover/page.tsx
import { Suspense } from "react";export const dynamic = "force-dynamic";async function Picks() { await new Promise<void>(r => setTimeout(r, 500)); return <ul><li>Fern Field</li><li>Tide Notes</li></ul>;}export default function Page() { return <><h1>Discover books</h1><p>Browse our reading picks.</p> <Suspense fallback={<p role="status">Preparing picks...</p>}><Picks /></Suspense></>;}Expected behavior (not framework-tested): The heading and introduction are outside the waiting region; the list replaces its fallback after the synthetic operation resolves.
How it works
The parent must reach the boundary before the child suspends. Awaiting all slow work in the parent first defeats this placement. A loading.tsx beside a layout does not cover slow work awaited by that same layout before its children render. Move nonessential work inside a suitable child boundary; keep authorization before private disclosure. A single boundary groups its children into one reveal; separate sibling boundaries allow independent reveal when each resolves. Suspense is a React mechanism used by Next.js; arbitrary fetches started inside useEffect or click handlers do not activate it automatically. Errors may require an error boundary rather than a loading fallback.
Independent regions (partial JSX)
<section aria-label="Book details"> <Suspense fallback={<p role="status">Loading description...</p>}> <Description /> </Suspense> <Suspense fallback={<p role="status">Loading reviews...</p>}> <Reviews /> </Suspense></section>Expected behavior (not framework-tested): Description and Reviews are assumed async Server Components defined elsewhere. Neither needs to wait for the other to finish before revealing its content.
Common mistake
A single giant fallback can hide useful context. Conversely, dozens of tiny spinners fragment the interface. Pick boundaries by user-visible regions and dependencies, not by component count.
Practice and verification
Sketch a product page with title, description and optional reviews. Choose which information is required before anything appears, which can load separately, and which failure should not hide the rest.
Scope: App Router, proposed Next.js 16.x, Cache Components disabled for these labs. Snippets assume a reviewed TypeScript app and are static examples; framework behavior has not been executed. Exact supported patch and dependency set must be verified before running.