Skip to content

Releases: bvaughn/react-error-boundary

4.0.10

10 Jun 13:17

Choose a tag to compare

  • Target Safari 12+ compatibility (by removing optional chaining operator and default parameters)

4.0.9

31 May 01:30

Choose a tag to compare

  • 145: Removed explicit ErrorBoundary.render return type to avoid TypeScript error:

'ErrorBoundary' cannot be used as a JSX component.

4.0.8

29 May 20:59

Choose a tag to compare

  • 144: Build release bundle with Preconstruct

4.0.7

27 May 20:33

Choose a tag to compare

*Replaced post-processing "use client" insertion step with a custom Parcel plug-in. This should hopefully produce better source maps.

4.0.6

27 May 19:02

Choose a tag to compare

  • Removed arrow function syntax to support older versions of Safari

4.0.5

27 May 18:57

Choose a tag to compare

Move "use client" directive to top of the bundled file.

4.0.4

17 Apr 19:06

Choose a tag to compare

README changes only

4.0.3

12 Apr 13:20

Choose a tag to compare

  • withErrorBoundary forwards refs
  • Add "use client" directive

4.0.2

23 Mar 14:07

Choose a tag to compare

Fix broken TypeScript definitions file (#133, parcel-bundler/parcel#8908)

4.0.1

22 Mar 14:15

Choose a tag to compare

  • Render ErrorBoundaryContext around fallback UI as well, so the useErrorBoundary hook could be used within the fallback component to reset the boundary.

For example:

import { useErrorBoundary } from "react-error-boundary";

function ErrorFallback({ error }) {
  const { resetBoundary } = useErrorBoundary();

  return (
    <div role="alert">
      <p>Something went wrong:</p>
      <pre style={{ color: "red" }}>{error.message}</pre>
      <button onClick={resetBoundary}>Try again</button>
    </div>
  );
}

See this demo: https://codesandbox.io/s/nostalgic-browser-e9lpmf