Socket
Socket
Sign inDemoInstall

react-error-boundary

Package Overview
Dependencies
Maintainers
1
Versions
47
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.2.1 to 2.2.2

4

dist/react-error-boundary.cjs.js

@@ -19,3 +19,3 @@ 'use strict';

return a.some(function (item, index) {
return a.length !== b.length || a.some(function (item, index) {
return !Object.is(item, b[index]);

@@ -98,3 +98,3 @@ });

if (React.isValidElement(fallback)) {
if ( /*#__PURE__*/React.isValidElement(fallback)) {
return fallback;

@@ -101,0 +101,0 @@ } else if (typeof fallbackRender === 'function') {

@@ -13,3 +13,3 @@ import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';

return a.some(function (item, index) {
return a.length !== b.length || a.some(function (item, index) {
return !Object.is(item, b[index]);

@@ -92,3 +92,3 @@ });

if (React.isValidElement(fallback)) {
if ( /*#__PURE__*/React.isValidElement(fallback)) {
return fallback;

@@ -95,0 +95,0 @@ } else if (typeof fallbackRender === 'function') {

@@ -24,3 +24,3 @@ (function (global, factory) {

return a.some(function (item, index) {
return a.length !== b.length || a.some(function (item, index) {
return !Object.is(item, b[index]);

@@ -103,3 +103,3 @@ });

if (React.isValidElement(fallback)) {
if ( /*#__PURE__*/React.isValidElement(fallback)) {
return fallback;

@@ -106,0 +106,0 @@ } else if (typeof fallbackRender === 'function') {

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

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