React — Interview Questions & Mental Models
Error boundaries
- Class-only: componentDidCatch / getDerivedStateFromError — no hook equivalent yet for catching render errors in children.
- Function components can still throw to a boundary above.
- Boundaries don't catch event handler errors — use try/catch there.