← All notes

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

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:

Caveats

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

Claims

Sources

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.

License: CC-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.

Cite this

Permanent ID: iil:note:2wp7s8m7

iinventedlight. 2026. "Suspense shows a fallback until lazy code or use()-read data inside it is ready." iinventedlight Library, iil:note:2wp7s8m7, version of 2026-11-18. https://iinventedlight.com/library/notes/react-suspense/. License: CC-BY-4.0.

@misc{iil_note_2wp7s8m7,
  author = {{iinventedlight}},
  title = {{Suspense shows a fallback until lazy code or use()-read data inside it is ready}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/react-suspense/},
  note = {Permanent ID iil:note:2wp7s8m7. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/react-suspense.md.