npm / react-error-boundary
react-error-boundary
What changed in react-error-boundary 4 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
4 breaking2 new APIs and options1 performance1 tooling6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initreact-error-boundary 610 changes
Breaking changes 2
The error type changes from Error to unknown.
The module is ESM-only to better work with modern tooling.
New APIs and options 1
Exports the getErrorMessage helper method.
Performance 1
Context values are memoized to avoid unnecessary consumer renders when boundary state is unchanged.
Tooling 1
Added @types/react as an optional peer dependency.
Fixes and other changes 5
An explicitly provided undefined fallback is accepted, but logs an error in development.
Types preserve optional defaulted props in withErrorBoundary.
Infers the wrapped component's ref type.
Handles the edge case where null is used as a thrown value.
Removed react-dom from the peer dependencies list because it was accidentally added during a previous internal refactor.
react-error-boundary 51 changes
Fixes and other changes 1
Updated the withErrorBoundary types to be compatible with the latest forwardRef types.
react-error-boundary 43 changes
Breaking changes 2
onReset and onResetKeys behavior is merged; onReset receives a details object explaining the cause of the reset.
Replaced by useErrorBoundary. For errors already available during render, throw the value directly instead.
New APIs and options 1
Adds showBoundary to send errors from event handlers or async code to the nearest boundary, and resetBoundary to request a retry.