How do error boundaries work in React and what errors do they not catch?

Updated Apr 23, 2026

Short answer

A class component implementing getDerivedStateFromError and/or componentDidCatch (or framework equivalents) acts as an error boundary: it catches render errors in descendants and can render fallback UI. They do not catch errors in event handlers, async code, SSR errors outside boundaries, or errors in the boundary itself.

Deep explanation

Error boundaries are declarative try/catch for the React render phase. For events and async work, use normal try/catch. Place boundaries at route or feature boundaries to isolate failures.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More React interview questions

View all →