Class component dùng componentDidCatch và getDerivedStateFromError bắt lỗi render.
- Hiển thị fallback UI thay vì crash toàn app.
- Hạn chế: không bắt lỗi trong event handlers, async code, SSR, và chính Error Boundary.
- Dùng react-error-boundary library cho function components.