// the find
bvaughn/react-error-boundary
Simple reusable React error boundary component
A thin wrapper around React's class-based error boundary API, giving you a functional component interface and a `useErrorBoundary` hook. It exists because React still requires class components for error boundaries and nobody wants to write one by hand. If you're using React in any serious app, you're already using this or should be.
The three fallback patterns (static `fallback`, `FallbackComponent`, and `fallbackRender` render prop) cover every real use case without forcing you into one style. The `resetKeys` prop is genuinely useful — tie it to your query key or route param and the boundary resets automatically when the relevant state changes. `useErrorBoundary` lets you funnel async and event-handler errors into the boundary without wrapping everything in try/catch. Maintained by Brian Vaughn, a former React core team member, so it tracks React's own semantics accurately.
The three fallback props doing the same job in different shapes is an API smell — most users never need more than one, and the docs don't clearly tell you which to default to. The integrations directory appears to be test scaffolding for a resizable panel library (the test utilities reference panel layout and separators), not error-boundary integration tests — it looks like accidental copy-paste in the repo structure. Error boundaries still don't catch async errors by default, and while `useErrorBoundary` helps, it requires manual call sites; there's no automatic instrumentation for promise rejections. No built-in support for error fingerprinting or deduplication before calling `onError`, so if you're logging to Sentry or Datadog you'll do that wiring yourself.