react-error-boundary
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -56,3 +56,3 @@ 'use strict'; | ||
try { | ||
onError(error, info ? info.componentStack : ''); | ||
onError.call(this, error, info ? info.componentStack : ""); | ||
} catch (ignoredError) {} | ||
@@ -59,0 +59,0 @@ } |
@@ -39,3 +39,3 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
try { | ||
onError(error, info ? info.componentStack : ''); | ||
onError.call(this, error, info ? info.componentStack : ""); | ||
} catch (ignoredError) {} | ||
@@ -42,0 +42,0 @@ } |
@@ -622,3 +622,3 @@ !function(root, factory) { | ||
if ("function" == typeof onError) try { | ||
onError(error, info ? info.componentStack : ""); | ||
onError.call(this, error, info ? info.componentStack : ""); | ||
} catch (ignoredError) {} | ||
@@ -625,0 +625,0 @@ this.setState({ |
{ | ||
"name": "react-error-boundary", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Sample reusable React error boundary component for React 16+", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -16,3 +16,3 @@ # react-error-boundary | ||
You can also react to errors (eg for logging) by providing an `onError` callback: | ||
You can react to errors (eg for logging) by providing an `onError` callback: | ||
@@ -41,2 +41,14 @@ ```jsx | ||
</ErrorBoundary> | ||
``` | ||
You can also use it as a HOC: | ||
```jsx | ||
import {withErrorBoundary} from 'react-error-boundary'; | ||
const ComponentWithErrorBoundary = withErrorBoundary( | ||
ComponentToDecorate: Element<any>, | ||
CustomFallbackComponent: ?Element<any>, | ||
onErrorHandler: ?(error: Error, componentStack: string) => void, | ||
); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76250
52