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 pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro