use-error-boundary

React hook for using error boundaries in your functional components

MIT License

Downloads
86.5K
Stars
214
Committers
4

Bot releases are hidden (Show)

use-error-boundary - Update peerDependencies to include React >=16.9.0 Latest Release

Published by JoschuaSchneider over 3 years ago

You can now install this package with React 17 🎉

  • Update React peerDependency to >=16.9.0
  • Add optional react-dom dependency
  • Update React related devDependencies to React 17
use-error-boundary - Reset error-boundary state

Published by JoschuaSchneider over 3 years ago

Introduces a reset method to reset the error boundary state.

Thanks to @futursolo (#21 ) for the suggestion!

  • Add reset functionality
  • Updated vulnerable dev-dependencies
  • Streamlined documentation
use-error-boundary - Removed unused prop-types dependency

Published by JoschuaSchneider about 4 years ago

This package no longer makes use of prop-types as a dependency.

use-error-boundary - Fixed new CI integration, bumped version

Published by JoschuaSchneider about 4 years ago

Fixed CI integration, new releases will be published to npm.

For full release notes check out Moving to TypeScript

use-error-boundary - Hotfix for broken test

Published by JoschuaSchneider about 4 years ago

Hotfix for broken tests in CI environment.

For full Release notes, check out Release Move to Typescript

use-error-boundary - Move to Typescript

Published by JoschuaSchneider about 4 years ago

Release 2.0.0 - Moving the project to TypeScript

This update includes:

  • Full implementation in TypeScript.
  • Streamlined building pipeline using microbundle (including unpgk support)
  • Improved tests using @testing-library/react to test closer to the implementation.

Breaking changes

This removes the errorInfo property from the hook return value and from the renderError callback.

This is because the ErrorBoundary uses the static getDerivedStateFromError to set its error state. This method does not provide the errorInfo object.

As an alternative, I have introduces an optional options object with an onDidCatch callback:

useErrorBoundary({
  onDidCatch: (error, errorInfo) => {}
})

Types

Types are now included via the npm "types" config key.

use-error-boundary - Moved "react" to dev and peer dependencies

Published by JoschuaSchneider about 4 years ago

This release moves react out of the dependencies and into peerDependencies and devDependencies to avoid multiple react versions when importing this module.

Thanks to @mossymaker for the PR.

use-error-boundary - Documentation updates

Published by JoschuaSchneider over 4 years ago

Improved documentation and examples:

  • Included some info on common pitfalls (like using a different boundary component)
  • Better illustrated the use of the render props api.
  • Removed unnecessary comments from the code examples.
use-error-boundary - Updated vulnerable dependencies.

Published by JoschuaSchneider almost 5 years ago

Updated vulnerable dependencies using npm audit.

use-error-boundary - Updated vulnerable dependencies.

Published by JoschuaSchneider almost 5 years ago

Updated a few vulnarable dependencies.

Package Rankings
Top 2.59% on Npmjs.org
Badges
Extracted from project README
npm version
Related Projects