Error Boundaries
An error boundary is a class (or a small library wrapper) that catches render errors in its child tree and shows a fallback UI instead of a white screen. getDerivedStateFromError + componentDidCatch. It does not catch errors in event handlers, async code, or the boundary’s own render — those still need try/catch / error state.
Function components cannot be error boundaries by themselves. react-error-boundary is the usual wrapper. Put a boundary around a risky widget, not necessarily the whole app only.
Error Boundaries — child throw during render → Something broke. Click handler errors still need try/catch.
What it catches vs doesn’t. Class-only core API.