react-use-error-boundary

A React hook for error boundaries in function components

MIT License

Downloads
34.3K
Stars
48
Committers
3

Bot releases are visible (Hide)

react-use-error-boundary - v3.0.0 Latest Release

Published by tatethurston over 2 years ago

What's Changed

const [error] = useErrorBoundary();
  • The error wrapping that was introduced in v2 has been removed. error will now be the error that was caught without any wrapping for thrown primitives. The types have been updated to unknown to reflect that thrown JavaScript errors may be any type not just instances of Error.

  • withErrorBoundary now propagates the wrapped component display name for improved debugging with React dev tools. It will display as WithErrorBoundary(${Component.displayName}).

Full Changelog: https://github.com/tatethurston/react-use-error-boundary/compare/v2.0.1...v3.0.0

react-use-error-boundary - v2.0.1

Published by tatethurston over 2 years ago

What's Changed

Publish CommonJS and ESM.

Full Changelog: https://github.com/tatethurston/react-use-error-boundary/compare/v2.0.0...v2.0.1

react-use-error-boundary - v2.0.0

Published by tatethurston over 2 years ago

What's Changed

const [error] = useErrorBoundary();

error is now the error that was caught or undefined if nothing errored. Previously error was a boolean value. Providing access to the error rather than a boolean makes it more ergonomic to render UI in response to the caught error. Special thanks to @davwheat for the contribution.

If something other than an instance of Error is thrown, it will be wrapped in an Error object by calling new Error() on the thrown value. A warning will log when this occurs: while you may throw any value in JavaScript, you should only throw instances of Error. This ensures a stack trace is collected and that all errors conform to a unified interface. This wrapping may be removed in a future v3 release of this library.

New Contributors

Full Changelog: https://github.com/tatethurston/react-use-error-boundary/compare/v1.0.2...v2.0.0

react-use-error-boundary - v1.0.2

Published by tatethurston over 2 years ago

What's Changed

Full Changelog: https://github.com/tatethurston/react-use-error-boundary/compare/v1.0.1...v1.0.2

react-use-error-boundary - v1.0.1

Published by tatethurston over 2 years ago

What's Changed

Internal: fix CI publishes.

Full Changelog: https://github.com/tatethurston/react-use-error-boundary/compare/v1.0.0...v1.0.1

react-use-error-boundary - v1.0.0

Published by tatethurston over 2 years ago

v1.0.0

No API changes. This library will now follow semantic versioning.