Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-error-boundary

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-error-boundary - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

dist/commonjs/ErrorBoundary.js

@@ -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,
);
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc