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 2.0.0 to 2.0.1

6

dist/react-error-boundary.cjs.js

@@ -63,7 +63,7 @@ 'use strict';

if (fallback) {
if (React.isValidElement(fallback)) {
return fallback;
} else if (fallbackRender) {
} else if (typeof fallbackRender === 'function') {
return fallbackRender(props);
} else if (FallbackComponent) {
} else if (typeof FallbackComponent === 'function') {
return /*#__PURE__*/React.createElement(FallbackComponent, props);

@@ -70,0 +70,0 @@ } else {

@@ -57,7 +57,7 @@ import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';

if (fallback) {
if (React.isValidElement(fallback)) {
return fallback;
} else if (fallbackRender) {
} else if (typeof fallbackRender === 'function') {
return fallbackRender(props);
} else if (FallbackComponent) {
} else if (typeof FallbackComponent === 'function') {
return /*#__PURE__*/React.createElement(FallbackComponent, props);

@@ -64,0 +64,0 @@ } else {

@@ -68,7 +68,7 @@ (function (global, factory) {

if (fallback) {
if (React.isValidElement(fallback)) {
return fallback;
} else if (fallbackRender) {
} else if (typeof fallbackRender === 'function') {
return fallbackRender(props);
} else if (FallbackComponent) {
} else if (typeof FallbackComponent === 'function') {
return /*#__PURE__*/React.createElement(FallbackComponent, props);

@@ -75,0 +75,0 @@ } else {

@@ -1,2 +0,2 @@

!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((r=r||self).ReactErrorBoundary={},r.React)}(this,(function(r,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var t={error:null,info:null},o=function(r){var o,n;function a(){for(var e,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return(e=r.call.apply(r,[this].concat(n))||this).state=t,e.resetErrorBoundary=function(){return e.setState(t)},e}n=r,(o=a).prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n;var c=a.prototype;return c.componentDidCatch=function(r,e){var t,o;null==(t=(o=this.props).onError)||t.call(o,r,null==e?void 0:e.componentStack),this.setState({error:r,info:e})},c.render=function(){var r=this.state,t=r.error,o=r.info,n=this.props,a=n.fallbackRender,c=n.FallbackComponent,l=n.fallback;if(null!==t){var i={componentStack:null==o?void 0:o.componentStack,error:t,resetErrorBoundary:this.resetErrorBoundary};if(l)return l;if(a)return a(i);if(c)return e.createElement(c,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},a}(e.Component);r.ErrorBoundary=o,r.withErrorBoundary=function(r,t){function n(n){return e.createElement(o,t,e.createElement(r,n))}var a=r.displayName||r.name||"Unknown";return n.displayName="withErrorBoundary("+a+")",n},Object.defineProperty(r,"__esModule",{value:!0})}));
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((r=r||self).ReactErrorBoundary={},r.React)}(this,(function(r,e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var t={error:null,info:null},o=function(r){var o,n;function a(){for(var e,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return(e=r.call.apply(r,[this].concat(n))||this).state=t,e.resetErrorBoundary=function(){return e.setState(t)},e}n=r,(o=a).prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n;var c=a.prototype;return c.componentDidCatch=function(r,e){var t,o;null==(t=(o=this.props).onError)||t.call(o,r,null==e?void 0:e.componentStack),this.setState({error:r,info:e})},c.render=function(){var r=this.state,t=r.error,o=r.info,n=this.props,a=n.fallbackRender,c=n.FallbackComponent,i=n.fallback;if(null!==t){var l={componentStack:null==o?void 0:o.componentStack,error:t,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(i))return i;if("function"==typeof a)return a(l);if("function"==typeof c)return e.createElement(c,l);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},a}(e.Component);r.ErrorBoundary=o,r.withErrorBoundary=function(r,t){function n(n){return e.createElement(o,t,e.createElement(r,n))}var a=r.displayName||r.name||"Unknown";return n.displayName="withErrorBoundary("+a+")",n},Object.defineProperty(r,"__esModule",{value:!0})}));
//# sourceMappingURL=react-error-boundary.umd.min.js.map
{
"name": "react-error-boundary",
"version": "2.0.0",
"version": "2.0.1",
"description": "Simple reusable React error boundary component",

@@ -5,0 +5,0 @@ "main": "dist/react-error-boundary.cjs.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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