---
source: https://iinventedlight.com/library/notes/react-suspense.md
title: "Suspense shows a fallback until lazy code or use()-read data inside it is ready"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (React docs (reference)); CC-BY-4.0 (reactjs/react.dev (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: React docs (reference), Suspense; reactjs/react.dev (GitHub), lazy (source page). CC-BY-4.0 (https://raw.githubusercontent.com/reactjs/react.dev/main/LICENSE-DOCS.md). Copyright Meta Platforms, Inc. and affiliates."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: React Suspense and lazy"
tags: [react, Suspense, lazy, fallback, loading, code-splitting]
client: Librarian
sources:
  - id: S1
    title: "Suspense"
    publisher: React docs (reference)
    url: https://react.dev/reference/react/Suspense
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "lazy (source page)"
    publisher: reactjs/react.dev (GitHub)
    url: https://github.com/reactjs/react.dev/blob/main/src/content/reference/react/lazy.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# Suspense shows a fallback until lazy code or use()-read data inside it is ready
**Answer:** `<Suspense fallback={<Loading />}>` lets you display a fallback until its children have finished loading. The loading fallback stays visible until all the code and data the children need has been loaded.

## Example

```jsx
import { Suspense, lazy } from 'react';
const MarkdownPreview = lazy(() => import('./MarkdownPreview.js'));
export default function Page() {
  return (
    <Suspense fallback={<Loading />}>
      <MarkdownPreview />
    </Suspense>
  );
}
```

## What activates a boundary

A Suspense boundary waits for its content to be ready before revealing it. Two things keep a boundary from revealing content:
- Lazy-loading component code with `lazy`.
- Reading a Promise with `use`, such as data streamed from Server Components or loaded by a Suspense-enabled framework.

## Caveats

- Suspense does not detect when data is fetched inside an Effect or event handler.
- For renders that got suspended before they could mount for the first time, React does not preserve any state.
- Nested boundaries reveal nested content as it loads; a Transition can show stale content while fresh content is loading.

## lazy rules

`lazy` lets you defer loading a component's code until it is rendered for the first time. Always declare lazy components at the top level of your module, not inside a component, or their state will be reset on re-renders.

## See also

- [react-usetransition](https://iinventedlight.com/library/notes/react-usetransition/)
- [react-components-basics](https://iinventedlight.com/library/notes/react-components-basics/)
- [nextjs-loading-ui](https://iinventedlight.com/library/notes/nextjs-loading-ui/)

## Claims

- id: C1
  claim: Suspense displays a fallback until children finish loading.
  source: S1
  evidence: "lets you display a fallback until its children have finished loading"

- id: C2
  claim: Suspense does not detect fetching inside an Effect or event handler.
  source: S1
  evidence: "Suspense does not detect when data is fetched inside an Effect or event handler."

- id: C3
  claim: Lazy-loading with lazy activates a boundary.
  source: S1
  evidence: "Lazy-loading component code with lazy"

- id: C4
  claim: lazy defers loading a component's code until first render.
  source: S2
  evidence: "lets you defer loading component's code until it is rendered for the first time"

## Sources

- [S1] Suspense. React docs (reference). https://react.dev/reference/react/Suspense . License: CC-BY-4.0. Accessed 2026-11-18.

- [S2] lazy (source page). reactjs/react.dev (GitHub). https://github.com/reactjs/react.dev/blob/main/src/content/reference/react/lazy.md . License: CC-BY-4.0. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: React docs (reference), Suspense; reactjs/react.dev (GitHub), lazy (source page). CC-BY-4.0 (https://raw.githubusercontent.com/reactjs/react.dev/main/LICENSE-DOCS.md). Copyright Meta Platforms, Inc. and affiliates. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
