liveBook · Manning

Error boundary

An error boundary is a React component mechanism that catches errors in descendant components and renders fallback UI to isolate the affected component tree.

How 3 Manning books explain it

React Hooks in Action: With Suspense and Concurrent Mode

ErrorBoundary is a reusable React component from react-error-boundary that catches descendant rendering errors and renders a configured fallback component.

How it is used
Contains descendant rendering failures and separates error fallback UI from application components.
How deep it goes
Explains class lifecycle mechanics, configurable fallbacks, nested Suspense placement, and recovery callbacks without detailing React internals.
Examples
Uses bookings routes, a deliberately throwing BookableForm, lazy calendars, Message loading, and a Try Again recovery button.
What you can do after
Apply it via react-error-boundary by configuring fallback components, isolating subtrees, and wiring reset-based recovery.

Read how React Hooks in Action: With Suspense and Concurrent Mode explains error boundary →

Web Components in Action

An error boundary is a React component mechanism that confines errors from a component subtree so they do not unmount or disrupt the rest of the application.

How it is used
Frames error handling as a React component-lifecycle concern that protects unaffected components and application content.
How deep it goes
Defines the isolation goal and React’s historical motivation but stops short of implementation details or boundary code.
Examples
Contrasts an error confined to one React component with pre-version-16 errors that could unmount the entire application.
What you can do after
Evaluate how React isolates component errors and distinguish that behavior from Web Components’ decentralized error handling.

Read how Web Components in Action explains error boundary →

Build AI-Enhanced Web Apps

A React component pattern that catches rendering errors in descendant components and renders fallback content.

How it is used
Protects production React and Next.js interfaces from blank screens after rendering failures.
How deep it goes
Defines the production purpose and contrasts it with development overlays, while deferring implementation instructions to React documentation.
Examples
Uses a Next.js call-stack overlay, blank production screens, meaningful error messages, and recovery call-to-action buttons.
What you can do after
Configure production rendering-error handling that gives users feedback and recovery options instead of blank screens.

Read how Build AI-Enhanced Web Apps explains error boundary →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.