react-error-boundary
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
27850
223
0