Suspense
A React component that shows a fallback, such as a spinner or skeleton, while components inside it are waiting for something to load.
In more detail
A component suspends when it reads a pending promise with use or is a lazy component whose code has not loaded. React then shows the fallback of the nearest Suspense above it and retries when the promise resolves. Nesting several boundaries lets fast parts of the page appear before slow ones.
Examples
<Suspense fallback={<CardSkeleton />}>
<Recommendations />
</Suspense><Suspense fallback={<Spinner />}><Profile /></Suspense>Related terms
- fallback UI — The placeholder content React shows instead of part of the tree, either while it loads (Suspense) or after it crashes (error boundary).
- loading.tsx — A special file whose component Next.js shows instantly while a route segment's page is loading, by wrapping the page in Suspense.
- streaming SSR — Server-side rendering that sends the HTML shell immediately and streams the rest of the page as each piece of data becomes ready.
- use() — The React 19 API that reads a value from a Promise or a context, and unlike hooks may be called inside conditions and loops.
- React.lazy — The React function that defines a component whose code is loaded with a dynamic import the first time it renders.
- error boundary — A class component that catches errors thrown while rendering its children and shows a fallback UI instead of crashing the whole app.
Taught in
- Loading UI: Instant Loading States with loading.tsx — Next.js 15 & Modern App Router Architecture
- Granular Suspense: Resolving Waterfall Bottlenecks — Next.js 15 & Modern App Router Architecture
- The use() Hook: Reading Promises And Context Directly — React 19 & Modern Component Architecture
- Suspense Architecture: Promises, Fallbacks, And Co-ordination — React 19 & Modern Component Architecture
- Code-Splitting with React.lazy: Dynamic Imports And Chunks — React 19 & Modern Component Architecture
- React Portals: Escaping Stacking Contexts for Modals — React 19 & Modern Component Architecture
- Client-Side Data Fetching Architectures with Suspense — React 19 & Modern Component Architecture