react-error-boundaries

Implements class-based React error boundaries with fallback UI and retry logic.

Updated Jul 27, 2026
One-click install
npx skills add https://github.com/arayaroma/ether --skill react-error-boundaries-arayaroma
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-error-boundaries
Source: https://github.com/arayaroma/ether/tree/main/skills/react-error-boundaries
Command: npx skills add https://github.com/arayaroma/ether --skill react-error-boundaries-arayaroma

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? A single render or lifecycle error in one React component can unmount and blank the entire application. This Skill provides a class-based ErrorBoundary component that catches errors in a subtree, renders a fallback UI, and offers a retry action so one broken feature does not take down the whole screen. ## Core Features & Use Cases - Class-based ErrorBoundary component: Uses getDerivedStateFromError for the fallback render and componentDidCatch for logging and error-tracker reporting, since no hook equivalent exists. - Placement guidance: Wrap independent feature sections (charts, widgets, routed pages) in their own boundaries in addition to a root-level catch-all. - Boundary limitations and retry semantics: Documents that boundaries do not catch errors in event handlers, async code, SSR, or their own render, and that retry must also clear or refetch the bad underlying state. - Use Case: A dashboard widget crashes due to malformed API data; its local boundary shows a "Try again" fallback while the rest of the page keeps working. ## Quick Start Add an error boundary around my React feature components so a render error shows a fallback with a retry button instead of blanking the app.

Frequently Asked Questions about react-error-boundaries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an error boundary in React?▼

Create a class component implementing getDerivedStateFromError to set error state and componentDidCatch to log the error, then render a fallback UI when an error exists. Wrap child components with it, for example <ErrorBoundary><App /></ErrorBoundary>.

Can React error boundaries be written as function components with hooks?▼

No, error boundaries must be class components because no hook equivalent exists for getDerivedStateFromError or componentDidCatch. Function components can be wrapped by a boundary but cannot act as one themselves.

Do React error boundaries catch errors in event handlers or async code?▼

No, error boundaries do not catch errors in event handlers, asynchronous code, server-side rendering, or the boundary's own render. Handle those cases with regular try/catch blocks and set error state manually.

Why does clicking retry in an error boundary immediately throw again?▼

Retry only resets the boundary's own hasError state; if the error came from bad data still held in a parent store, re-rendering re-throws the same error. Pair the retry action with refetching or clearing the faulty state.

Where should error boundaries be placed in a React app?▼

A single root-level boundary is not enough on its own. Wrap independent feature sections such as charts, widgets, or routed pages in their own boundaries so one broken feature does not blank the entire screen.