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.0.0 to 1.1.0

49

dist/commonjs/ErrorBoundary.js

@@ -6,2 +6,3 @@ 'use strict';

});
exports.withErrorBoundary = undefined;

@@ -26,24 +27,25 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var babelPluginFlowReactPropTypes_proptype_ComponentType = require('react').babelPluginFlowReactPropTypes_proptype_ComponentType || require('prop-types').any;
var ErrorBoundary = function (_Component) {
_inherits(ErrorBoundary, _Component);
function ErrorBoundary(props, context) {
function ErrorBoundary() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ErrorBoundary);
var _this = _possibleConstructorReturn(this, (ErrorBoundary.__proto__ || Object.getPrototypeOf(ErrorBoundary)).call(this, props, context));
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this.state = {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ErrorBoundary.__proto__ || Object.getPrototypeOf(ErrorBoundary)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
error: null,
info: null
};
return _this;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(ErrorBoundary, [{
key: 'unstable_handleError',
value: function unstable_handleError(error, info) {
// This method is a fallback for react <= 16.0.0-alpha.13
this.componentDidCatch(error, info);
}
}, {
key: 'componentDidCatch',

@@ -57,3 +59,3 @@ value: function componentDidCatch(error, info) {

onError(error, info ? info.componentStack : '');
} catch (error) {}
} catch (ignoredError) {}
}

@@ -75,3 +77,6 @@

if (error !== null) {
return _react2.default.createElement(FallbackComponent, { componentStack: info ? info.componentStack : '', error: error });
return _react2.default.createElement(FallbackComponent, {
componentStack: info ? info.componentStack : '',
error: error
});
}

@@ -90,6 +95,18 @@

ErrorBoundary.propTypes = {
children: require('prop-types').any,
FallbackComponent: require('prop-types').any.isRequired,
onError: require('prop-types').func
error: typeof Error === 'function' ? require('prop-types').instanceOf(Error) : require('prop-types').any,
info: require('prop-types').shape({
componentStack: require('prop-types').string.isRequired
})
};
var withErrorBoundary = exports.withErrorBoundary = function withErrorBoundary(Component, FallbackComponent, onError) {
return function (props) {
return _react2.default.createElement(
ErrorBoundary,
{ FallbackComponent: FallbackComponent, onError: onError },
_react2.default.createElement(Component, props)
);
};
};
withErrorBoundary.propTypes = babelPluginFlowReactPropTypes_proptype_ComponentType === require('prop-types').any ? {} : babelPluginFlowReactPropTypes_proptype_ComponentType;
exports.default = ErrorBoundary;

@@ -26,3 +26,5 @@ "use strict";

{ style: svgStyle, viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid" },
_react2.default.createElement("path", { d: "M20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,\n 12M22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,\n 12M15.5,8C16.3,8 17,8.7 17,9.5C17,10.3 16.3,11 15.5,11C14.7,11 14,10.3 14,\n 9.5C14,8.7 14.7,8 15.5,8M10,9.5C10,10.3 9.3,11 8.5,11C7.7,11 7,10.3 7,9.5C7,\n 8.7 7.7,8 8.5,8C9.3,8 10,8.7 10,9.5M12,14C13.75,14 15.29,14.72 16.19,\n 15.81L14.77,17.23C14.32,16.5 13.25,16 12,16C10.75,16 9.68,16.5 9.23,\n 17.23L7.81,15.81C8.71,14.72 10.25,14 12,14Z" })
_react2.default.createElement("path", {
d: "M20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,\n 12M22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,\n 12M15.5,8C16.3,8 17,8.7 17,9.5C17,10.3 16.3,11 15.5,11C14.7,11 14,10.3 14,\n 9.5C14,8.7 14.7,8 15.5,8M10,9.5C10,10.3 9.3,11 8.5,11C7.7,11 7,10.3 7,9.5C7,\n 8.7 7.7,8 8.5,8C9.3,8 10,8.7 10,9.5M12,14C13.75,14 15.29,14.72 16.19,\n 15.81L14.77,17.23C14.32,16.5 13.25,16 12,16C10.75,16 9.68,16.5 9.23,\n 17.23L7.81,15.81C8.71,14.72 10.25,14 12,14Z"
})
)

@@ -29,0 +31,0 @@ );

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

});
exports.ErrorBoundaryFallbackComponent = exports.ErrorBoundary = undefined;
exports.ErrorBoundaryFallbackComponent = exports.withErrorBoundary = exports.ErrorBoundary = undefined;

@@ -21,2 +21,3 @@ var _ErrorBoundaryFallbackComponent = require('./ErrorBoundaryFallbackComponent');

exports.ErrorBoundary = _ErrorBoundary2.default;
exports.withErrorBoundary = _ErrorBoundary.withErrorBoundary;
exports.ErrorBoundaryFallbackComponent = _ErrorBoundaryFallbackComponent2.default;

@@ -9,24 +9,25 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';

var babelPluginFlowReactPropTypes_proptype_ComponentType = require('react').babelPluginFlowReactPropTypes_proptype_ComponentType || require('prop-types').any;
var ErrorBoundary = function (_Component) {
_inherits(ErrorBoundary, _Component);
function ErrorBoundary(props, context) {
function ErrorBoundary() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ErrorBoundary);
var _this = _possibleConstructorReturn(this, (ErrorBoundary.__proto__ || _Object$getPrototypeOf(ErrorBoundary)).call(this, props, context));
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this.state = {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ErrorBoundary.__proto__ || _Object$getPrototypeOf(ErrorBoundary)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
error: null,
info: null
};
return _this;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(ErrorBoundary, [{
key: 'unstable_handleError',
value: function unstable_handleError(error, info) {
// This method is a fallback for react <= 16.0.0-alpha.13
this.componentDidCatch(error, info);
}
}, {
key: 'componentDidCatch',

@@ -40,3 +41,3 @@ value: function componentDidCatch(error, info) {

onError(error, info ? info.componentStack : '');
} catch (error) {}
} catch (ignoredError) {}
}

@@ -58,3 +59,6 @@

if (error !== null) {
return React.createElement(FallbackComponent, { componentStack: info ? info.componentStack : '', error: error });
return React.createElement(FallbackComponent, {
componentStack: info ? info.componentStack : '',
error: error
});
}

@@ -73,8 +77,20 @@

ErrorBoundary.propTypes = {
children: require('prop-types').any,
FallbackComponent: require('prop-types').any.isRequired,
onError: require('prop-types').func
error: typeof Error === 'function' ? require('prop-types').instanceOf(Error) : require('prop-types').any,
info: require('prop-types').shape({
componentStack: require('prop-types').string.isRequired
})
};
export var withErrorBoundary = function withErrorBoundary(Component, FallbackComponent, onError) {
return function (props) {
return React.createElement(
ErrorBoundary,
{ FallbackComponent: FallbackComponent, onError: onError },
React.createElement(Component, props)
);
};
};
withErrorBoundary.propTypes = babelPluginFlowReactPropTypes_proptype_ComponentType === require('prop-types').any ? {} : babelPluginFlowReactPropTypes_proptype_ComponentType;
export default ErrorBoundary;

@@ -16,3 +16,5 @@ import React from 'react';

{ style: svgStyle, viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid" },
React.createElement("path", { d: "M20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,\n 12M22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,\n 12M15.5,8C16.3,8 17,8.7 17,9.5C17,10.3 16.3,11 15.5,11C14.7,11 14,10.3 14,\n 9.5C14,8.7 14.7,8 15.5,8M10,9.5C10,10.3 9.3,11 8.5,11C7.7,11 7,10.3 7,9.5C7,\n 8.7 7.7,8 8.5,8C9.3,8 10,8.7 10,9.5M12,14C13.75,14 15.29,14.72 16.19,\n 15.81L14.77,17.23C14.32,16.5 13.25,16 12,16C10.75,16 9.68,16.5 9.23,\n 17.23L7.81,15.81C8.71,14.72 10.25,14 12,14Z" })
React.createElement("path", {
d: "M20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,\n 12M22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,\n 12M15.5,8C16.3,8 17,8.7 17,9.5C17,10.3 16.3,11 15.5,11C14.7,11 14,10.3 14,\n 9.5C14,8.7 14.7,8 15.5,8M10,9.5C10,10.3 9.3,11 8.5,11C7.7,11 7,10.3 7,9.5C7,\n 8.7 7.7,8 8.5,8C9.3,8 10,8.7 10,9.5M12,14C13.75,14 15.29,14.72 16.19,\n 15.81L14.77,17.23C14.32,16.5 13.25,16 12,16C10.75,16 9.68,16.5 9.23,\n 17.23L7.81,15.81C8.71,14.72 10.25,14 12,14Z"
})
)

@@ -19,0 +21,0 @@ );

import ErrorBoundaryFallbackComponent from './ErrorBoundaryFallbackComponent';
import ErrorBoundary from './ErrorBoundary';
import ErrorBoundary, { withErrorBoundary } from './ErrorBoundary';
export default ErrorBoundary;
export { ErrorBoundary, ErrorBoundaryFallbackComponent };
export { ErrorBoundary, withErrorBoundary, ErrorBoundaryFallbackComponent };

@@ -114,3 +114,3 @@ !function(root, factory) {

var core = module.exports = {
version: "2.4.0"
version: "2.5.1"
};

@@ -128,3 +128,3 @@ "number" == typeof __e && (__e = core);

function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(9), IE8_DOM_DEFINE = __webpack_require__(33), toPrimitive = __webpack_require__(18), dP = Object.defineProperty;
var anObject = __webpack_require__(9), IE8_DOM_DEFINE = __webpack_require__(33), toPrimitive = __webpack_require__(17), dP = Object.defineProperty;
exports.f = __webpack_require__(4) ? Object.defineProperty : function(O, P, Attributes) {

@@ -151,11 +151,3 @@ if (anObject(O), P = toPrimitive(P, !0), anObject(Attributes), IE8_DOM_DEFINE) try {

function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(62), defined = __webpack_require__(15);
module.exports = function(it) {
return IObject(defined(it));
};
}, /* 6 */
/***/
function(module, exports, __webpack_require__) {
var global = __webpack_require__(0), core = __webpack_require__(1), ctx = __webpack_require__(32), hide = __webpack_require__(7), $export = function(type, name, source) {
var global = __webpack_require__(0), core = __webpack_require__(1), ctx = __webpack_require__(32), hide = __webpack_require__(6), $export = function(type, name, source) {
var key, own, out, IS_FORCED = type & $export.F, IS_GLOBAL = type & $export.G, IS_STATIC = type & $export.S, IS_PROTO = type & $export.P, IS_BIND = type & $export.B, IS_WRAP = type & $export.W, exports = IS_GLOBAL ? core : core[name] || (core[name] = {}), expProto = exports.prototype, target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {}).prototype;

@@ -196,5 +188,5 @@ IS_GLOBAL && (source = name);

$export.U = 64, // safe
$export.R = 128, // real proto method for `library`
$export.R = 128, // real proto method for `library`
module.exports = $export;
}, /* 7 */
}, /* 6 */
/***/

@@ -208,6 +200,14 @@ function(module, exports, __webpack_require__) {

};
}, /* 7 */
/***/
function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(62), defined = __webpack_require__(14);
module.exports = function(it) {
return IObject(defined(it));
};
}, /* 8 */
/***/
function(module, exports, __webpack_require__) {
var store = __webpack_require__(17)("wks"), uid = __webpack_require__(12), Symbol = __webpack_require__(0).Symbol, USE_SYMBOL = "function" == typeof Symbol;
var store = __webpack_require__(16)("wks"), uid = __webpack_require__(12), Symbol = __webpack_require__(0).Symbol, USE_SYMBOL = "function" == typeof Symbol;
(module.exports = function(name) {

@@ -260,10 +260,2 @@ return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)("Symbol." + name));

/***/
function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(38), enumBugKeys = __webpack_require__(23);
module.exports = Object.keys || function(O) {
return $keys(O, enumBugKeys);
};
}, /* 15 */
/***/
function(module, exports) {

@@ -275,10 +267,10 @@ // 7.2.1 RequireObjectCoercible(argument)

};
}, /* 16 */
}, /* 15 */
/***/
function(module, exports, __webpack_require__) {
var shared = __webpack_require__(17)("keys"), uid = __webpack_require__(12);
var shared = __webpack_require__(16)("keys"), uid = __webpack_require__(12);
module.exports = function(key) {
return shared[key] || (shared[key] = uid(key));
};
}, /* 17 */
}, /* 16 */
/***/

@@ -290,3 +282,3 @@ function(module, exports, __webpack_require__) {

};
}, /* 18 */
}, /* 17 */
/***/

@@ -306,3 +298,3 @@ function(module, exports, __webpack_require__) {

};
}, /* 19 */
}, /* 18 */
/***/

@@ -315,15 +307,15 @@ function(module, exports) {

};
}, /* 20 */
}, /* 19 */
/***/
function(module, exports) {
module.exports = !0;
}, /* 21 */
}, /* 20 */
/***/
function(module, exports) {
module.exports = {};
}, /* 22 */
}, /* 21 */
/***/
function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(9), dPs = __webpack_require__(61), enumBugKeys = __webpack_require__(23), IE_PROTO = __webpack_require__(16)("IE_PROTO"), Empty = function() {}, createDict = function() {
var anObject = __webpack_require__(9), dPs = __webpack_require__(61), enumBugKeys = __webpack_require__(23), IE_PROTO = __webpack_require__(15)("IE_PROTO"), Empty = function() {}, createDict = function() {
// Thrash, waste and sodomy: IE GC bug

@@ -345,2 +337,10 @@ var iframeDocument, iframe = __webpack_require__(34)("iframe"), i = enumBugKeys.length;

};
}, /* 22 */
/***/
function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(38), enumBugKeys = __webpack_require__(23);
module.exports = Object.keys || function(O) {
return $keys(O, enumBugKeys);
};
}, /* 23 */

@@ -368,3 +368,3 @@ /***/

function(module, exports, __webpack_require__) {
var global = __webpack_require__(0), core = __webpack_require__(1), LIBRARY = __webpack_require__(20), wksExt = __webpack_require__(25), defineProperty = __webpack_require__(3).f;
var global = __webpack_require__(0), core = __webpack_require__(1), LIBRARY = __webpack_require__(19), wksExt = __webpack_require__(25), defineProperty = __webpack_require__(3).f;
module.exports = function(name) {

@@ -431,3 +431,3 @@ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});

// 7.1.13 ToObject(argument)
var defined = __webpack_require__(15);
var defined = __webpack_require__(14);
module.exports = function(it) {

@@ -440,3 +440,3 @@ return Object(defined(it));

// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(2), toObject = __webpack_require__(30), IE_PROTO = __webpack_require__(16)("IE_PROTO"), ObjectProto = Object.prototype;
var has = __webpack_require__(2), toObject = __webpack_require__(30), IE_PROTO = __webpack_require__(15)("IE_PROTO"), ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function(O) {

@@ -513,3 +513,3 @@ return O = toObject(O), has(O, IE_PROTO) ? O[IE_PROTO] : "function" == typeof O.constructor && O instanceof O.constructor ? O.constructor.prototype : O instanceof Object ? ObjectProto : null;

"use strict";
var LIBRARY = __webpack_require__(20), $export = __webpack_require__(6), redefine = __webpack_require__(37), hide = __webpack_require__(7), has = __webpack_require__(2), Iterators = __webpack_require__(21), $iterCreate = __webpack_require__(60), setToStringTag = __webpack_require__(24), getPrototypeOf = __webpack_require__(31), ITERATOR = __webpack_require__(8)("iterator"), BUGGY = !([].keys && "next" in [].keys()), returnThis = function() {
var LIBRARY = __webpack_require__(19), $export = __webpack_require__(5), redefine = __webpack_require__(37), hide = __webpack_require__(6), has = __webpack_require__(2), Iterators = __webpack_require__(20), $iterCreate = __webpack_require__(60), setToStringTag = __webpack_require__(24), getPrototypeOf = __webpack_require__(31), ITERATOR = __webpack_require__(8)("iterator"), BUGGY = !([].keys && "next" in [].keys()), returnThis = function() {
return this;

@@ -533,3 +533,3 @@ };

if (// Fix native
$anyNative && (IteratorPrototype = getPrototypeOf($anyNative.call(new Base()))) !== Object.prototype && (// Set @@toStringTag to native iterators
$anyNative && (IteratorPrototype = getPrototypeOf($anyNative.call(new Base()))) !== Object.prototype && IteratorPrototype.next && (// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, !0), // fix for some old engines

@@ -553,7 +553,7 @@ LIBRARY || has(IteratorPrototype, ITERATOR) || hide(IteratorPrototype, ITERATOR, returnThis)),

function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(7);
module.exports = __webpack_require__(6);
}, /* 38 */
/***/
function(module, exports, __webpack_require__) {
var has = __webpack_require__(2), toIObject = __webpack_require__(5), arrayIndexOf = __webpack_require__(63)(!1), IE_PROTO = __webpack_require__(16)("IE_PROTO");
var has = __webpack_require__(2), toIObject = __webpack_require__(7), arrayIndexOf = __webpack_require__(63)(!1), IE_PROTO = __webpack_require__(15)("IE_PROTO");
module.exports = function(object, names) {

@@ -588,3 +588,3 @@ var key, O = toIObject(object), i = 0, result = [];

function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(27), createDesc = __webpack_require__(13), toIObject = __webpack_require__(5), toPrimitive = __webpack_require__(18), has = __webpack_require__(2), IE8_DOM_DEFINE = __webpack_require__(33), gOPD = Object.getOwnPropertyDescriptor;
var pIE = __webpack_require__(27), createDesc = __webpack_require__(13), toIObject = __webpack_require__(7), toPrimitive = __webpack_require__(17), has = __webpack_require__(2), IE8_DOM_DEFINE = __webpack_require__(33), gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(4) ? gOPD : function(O, P) {

@@ -607,6 +607,6 @@ if (O = toIObject(O), P = toPrimitive(P, !0), IE8_DOM_DEFINE) try {

value: !0
}), exports.ErrorBoundaryFallbackComponent = exports.ErrorBoundary = void 0;
}), exports.ErrorBoundaryFallbackComponent = exports.withErrorBoundary = exports.ErrorBoundary = void 0;
var _ErrorBoundaryFallbackComponent = __webpack_require__(28), _ErrorBoundaryFallbackComponent2 = _interopRequireDefault(_ErrorBoundaryFallbackComponent), _ErrorBoundary = __webpack_require__(44), _ErrorBoundary2 = _interopRequireDefault(_ErrorBoundary);
exports.default = _ErrorBoundary2.default, exports.ErrorBoundary = _ErrorBoundary2.default,
exports.ErrorBoundaryFallbackComponent = _ErrorBoundaryFallbackComponent2.default;
exports.withErrorBoundary = _ErrorBoundary.withErrorBoundary, exports.ErrorBoundaryFallbackComponent = _ErrorBoundaryFallbackComponent2.default;
}, /* 44 */

@@ -623,19 +623,16 @@ /***/

value: !0
});
var _getPrototypeOf = __webpack_require__(45), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(50), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(51), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(55), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(82), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(29), _react2 = _interopRequireDefault(_react), _ErrorBoundaryFallbackComponent = __webpack_require__(28), _ErrorBoundaryFallbackComponent2 = _interopRequireDefault(_ErrorBoundaryFallbackComponent), ErrorBoundary = function(_Component) {
function ErrorBoundary(props, context) {
}), exports.withErrorBoundary = void 0;
var _getPrototypeOf = __webpack_require__(45), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(50), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(51), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(55), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(81), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(29), _react2 = _interopRequireDefault(_react), _ErrorBoundaryFallbackComponent = __webpack_require__(28), _ErrorBoundaryFallbackComponent2 = _interopRequireDefault(_ErrorBoundaryFallbackComponent), ErrorBoundary = function(_Component) {
function ErrorBoundary() {
var _ref, _temp, _this, _ret;
(0, _classCallCheck3.default)(this, ErrorBoundary);
var _this = (0, _possibleConstructorReturn3.default)(this, (ErrorBoundary.__proto__ || (0,
_getPrototypeOf2.default)(ErrorBoundary)).call(this, props, context));
return _this.state = {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
return _temp = _this = (0, _possibleConstructorReturn3.default)(this, (_ref = ErrorBoundary.__proto__ || (0,
_getPrototypeOf2.default)(ErrorBoundary)).call.apply(_ref, [ this ].concat(args))),
_this.state = {
error: null,
info: null
}, _this;
}, _ret = _temp, (0, _possibleConstructorReturn3.default)(_this, _ret);
}
return (0, _inherits3.default)(ErrorBoundary, _Component), (0, _createClass3.default)(ErrorBoundary, [ {
key: "unstable_handleError",
value: function(error, info) {
this.componentDidCatch(error, info);
}
}, {
key: "componentDidCatch",

@@ -646,3 +643,3 @@ value: function(error, info) {

onError(error, info ? info.componentStack : "");
} catch (error) {}
} catch (ignoredError) {}
this.setState({

@@ -666,3 +663,12 @@ error: error,

FallbackComponent: _ErrorBoundaryFallbackComponent2.default
}, exports.default = ErrorBoundary;
};
exports.withErrorBoundary = function(Component, FallbackComponent, onError) {
return function(props) {
return _react2.default.createElement(ErrorBoundary, {
FallbackComponent: FallbackComponent,
onError: onError
}, _react2.default.createElement(Component, props));
};
};
exports.default = ErrorBoundary;
}, /* 45 */

@@ -693,3 +699,3 @@ /***/

// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(6), core = __webpack_require__(1), fails = __webpack_require__(11);
var $export = __webpack_require__(5), core = __webpack_require__(1), fails = __webpack_require__(11);
module.exports = function(KEY, exec) {

@@ -756,3 +762,3 @@ var fn = (core.Object || {})[KEY] || Object[KEY], exp = {};

function(module, exports, __webpack_require__) {
var $export = __webpack_require__(6);
var $export = __webpack_require__(5);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)

@@ -809,3 +815,3 @@ $export($export.S + $export.F * !__webpack_require__(4), "Object", {

function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(19), defined = __webpack_require__(15);
var toInteger = __webpack_require__(18), defined = __webpack_require__(14);
// true -> String#at

@@ -823,5 +829,5 @@ // false -> String#codePointAt

"use strict";
var create = __webpack_require__(22), descriptor = __webpack_require__(13), setToStringTag = __webpack_require__(24), IteratorPrototype = {};
var create = __webpack_require__(21), descriptor = __webpack_require__(13), setToStringTag = __webpack_require__(24), IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(7)(IteratorPrototype, __webpack_require__(8)("iterator"), function() {
__webpack_require__(6)(IteratorPrototype, __webpack_require__(8)("iterator"), function() {
return this;

@@ -836,3 +842,3 @@ }), module.exports = function(Constructor, NAME, next) {

function(module, exports, __webpack_require__) {
var dP = __webpack_require__(3), anObject = __webpack_require__(9), getKeys = __webpack_require__(14);
var dP = __webpack_require__(3), anObject = __webpack_require__(9), getKeys = __webpack_require__(22);
module.exports = __webpack_require__(4) ? Object.defineProperties : function(O, Properties) {

@@ -848,2 +854,3 @@ anObject(O);

var cof = __webpack_require__(39);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object("z").propertyIsEnumerable(0) ? Object : function(it) {

@@ -857,9 +864,11 @@ return "String" == cof(it) ? it.split("") : Object(it);

// true -> Array#includes
var toIObject = __webpack_require__(5), toLength = __webpack_require__(64), toIndex = __webpack_require__(65);
var toIObject = __webpack_require__(7), toLength = __webpack_require__(64), toAbsoluteIndex = __webpack_require__(65);
module.exports = function(IS_INCLUDES) {
return function($this, el, fromIndex) {
var value, O = toIObject($this), length = toLength(O.length), index = toIndex(fromIndex, length);
var value, O = toIObject($this), length = toLength(O.length), index = toAbsoluteIndex(fromIndex, length);
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) {
for (;length > index; ) if ((value = O[index++]) != value) return !0;
for (;length > index; ) // eslint-disable-next-line no-self-compare
if ((value = O[index++]) != value) return !0;
} else for (;length > index; index++) if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;

@@ -873,3 +882,3 @@ return !IS_INCLUDES && -1;

// 7.1.15 ToLength
var toInteger = __webpack_require__(19), min = Math.min;
var toInteger = __webpack_require__(18), min = Math.min;
module.exports = function(it) {

@@ -881,3 +890,3 @@ return it > 0 ? min(toInteger(it), 9007199254740991) : 0;

function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(19), max = Math.max, min = Math.min;
var toInteger = __webpack_require__(18), max = Math.max, min = Math.min;
module.exports = function(index, length) {

@@ -889,3 +898,4 @@ return index = toInteger(index), index < 0 ? max(index + length, 0) : min(index, length);

function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(0).document && document.documentElement;
var document = __webpack_require__(0).document;
module.exports = document && document.documentElement;
}, /* 67 */

@@ -895,4 +905,4 @@ /***/

__webpack_require__(68);
for (var global = __webpack_require__(0), hide = __webpack_require__(7), Iterators = __webpack_require__(21), TO_STRING_TAG = __webpack_require__(8)("toStringTag"), collections = [ "NodeList", "DOMTokenList", "MediaList", "StyleSheetList", "CSSRuleList" ], i = 0; i < 5; i++) {
var NAME = collections[i], Collection = global[NAME], proto = Collection && Collection.prototype;
for (var global = __webpack_require__(0), hide = __webpack_require__(6), Iterators = __webpack_require__(20), TO_STRING_TAG = __webpack_require__(8)("toStringTag"), DOMIterables = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), i = 0; i < DOMIterables.length; i++) {
var NAME = DOMIterables[i], Collection = global[NAME], proto = Collection && Collection.prototype;
proto && !proto[TO_STRING_TAG] && hide(proto, TO_STRING_TAG, NAME), Iterators[NAME] = Iterators.Array;

@@ -904,3 +914,3 @@ }

"use strict";
var addToUnscopables = __webpack_require__(69), step = __webpack_require__(70), Iterators = __webpack_require__(21), toIObject = __webpack_require__(5);
var addToUnscopables = __webpack_require__(69), step = __webpack_require__(70), Iterators = __webpack_require__(20), toIObject = __webpack_require__(7);
// 22.1.3.4 Array.prototype.entries()

@@ -943,3 +953,3 @@ // 22.1.3.13 Array.prototype.keys()

function(module, exports, __webpack_require__) {
__webpack_require__(73), __webpack_require__(79), __webpack_require__(80), __webpack_require__(81),
__webpack_require__(73), __webpack_require__(78), __webpack_require__(79), __webpack_require__(80),
module.exports = __webpack_require__(1).Symbol;

@@ -951,3 +961,3 @@ }, /* 73 */

// ECMAScript 6 symbols shim
var global = __webpack_require__(0), has = __webpack_require__(2), DESCRIPTORS = __webpack_require__(4), $export = __webpack_require__(6), redefine = __webpack_require__(37), META = __webpack_require__(74).KEY, $fails = __webpack_require__(11), shared = __webpack_require__(17), setToStringTag = __webpack_require__(24), uid = __webpack_require__(12), wks = __webpack_require__(8), wksExt = __webpack_require__(25), wksDefine = __webpack_require__(26), keyOf = __webpack_require__(75), enumKeys = __webpack_require__(76), isArray = __webpack_require__(77), anObject = __webpack_require__(9), toIObject = __webpack_require__(5), toPrimitive = __webpack_require__(18), createDesc = __webpack_require__(13), _create = __webpack_require__(22), gOPNExt = __webpack_require__(78), $GOPD = __webpack_require__(42), $DP = __webpack_require__(3), $keys = __webpack_require__(14), gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global.Symbol, $JSON = global.JSON, _stringify = $JSON && $JSON.stringify, HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object.prototype, USE_NATIVE = "function" == typeof $Symbol, QObject = global.QObject, setter = !QObject || !QObject.prototype || !QObject.prototype.findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
var global = __webpack_require__(0), has = __webpack_require__(2), DESCRIPTORS = __webpack_require__(4), $export = __webpack_require__(5), redefine = __webpack_require__(37), META = __webpack_require__(74).KEY, $fails = __webpack_require__(11), shared = __webpack_require__(16), setToStringTag = __webpack_require__(24), uid = __webpack_require__(12), wks = __webpack_require__(8), wksExt = __webpack_require__(25), wksDefine = __webpack_require__(26), enumKeys = __webpack_require__(75), isArray = __webpack_require__(76), anObject = __webpack_require__(9), toIObject = __webpack_require__(7), toPrimitive = __webpack_require__(17), createDesc = __webpack_require__(13), _create = __webpack_require__(21), gOPNExt = __webpack_require__(77), $GOPD = __webpack_require__(42), $DP = __webpack_require__(3), $keys = __webpack_require__(22), gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global.Symbol, $JSON = global.JSON, _stringify = $JSON && $JSON.stringify, HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object.prototype, USE_NATIVE = "function" == typeof $Symbol, QObject = global.QObject, setter = !QObject || !QObject.prototype || !QObject.prototype.findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
return 7 != _create(dP({}, "a", {

@@ -1014,3 +1024,3 @@ get: function() {

__webpack_require__(27).f = $propertyIsEnumerable, __webpack_require__(40).f = $getOwnPropertySymbols,
DESCRIPTORS && !__webpack_require__(20) && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable, !0),
DESCRIPTORS && !__webpack_require__(19) && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable, !0),
wksExt.f = function(name) {

@@ -1021,4 +1031,4 @@ return wrap(wks(name));

});
for (var symbols = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","), i = 0; symbols.length > i; ) wks(symbols[i++]);
for (var symbols = $keys(wks.store), i = 0; symbols.length > i; ) wksDefine(symbols[i++]);
for (var es6Symbols = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","), j = 0; es6Symbols.length > j; ) wks(es6Symbols[j++]);
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k; ) wksDefine(wellKnownSymbols[k++]);
$export($export.S + $export.F * !USE_NATIVE, "Symbol", {

@@ -1030,5 +1040,5 @@ // 19.4.2.1 Symbol.for(key)

// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function(key) {
if (isSymbol(key)) return keyOf(SymbolRegistry, key);
throw TypeError(key + " is not a symbol!");
keyFor: function(sym) {
if (!isSymbol(sym)) throw TypeError(sym + " is not a symbol!");
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
},

@@ -1075,3 +1085,3 @@ useSetter: function() {

}), // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol.prototype[TO_PRIMITIVE] || __webpack_require__(7)($Symbol.prototype, TO_PRIMITIVE, $Symbol.prototype.valueOf),
$Symbol.prototype[TO_PRIMITIVE] || __webpack_require__(6)($Symbol.prototype, TO_PRIMITIVE, $Symbol.prototype.valueOf),
// 19.4.3.5 Symbol.prototype[@@toStringTag]

@@ -1131,11 +1141,4 @@ setToStringTag($Symbol, "Symbol"), // 20.2.1.9 Math[@@toStringTag]

function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(14), toIObject = __webpack_require__(5);
module.exports = function(object, el) {
for (var key, O = toIObject(object), keys = getKeys(O), length = keys.length, index = 0; length > index; ) if (O[key = keys[index++]] === el) return key;
};
}, /* 76 */
/***/
function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(14), gOPS = __webpack_require__(40), pIE = __webpack_require__(27);
var getKeys = __webpack_require__(22), gOPS = __webpack_require__(40), pIE = __webpack_require__(27);
module.exports = function(it) {

@@ -1146,3 +1149,3 @@ var result = getKeys(it), getSymbols = gOPS.f;

};
}, /* 77 */
}, /* 76 */
/***/

@@ -1155,7 +1158,7 @@ function(module, exports, __webpack_require__) {

};
}, /* 78 */
}, /* 77 */
/***/
function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(5), gOPN = __webpack_require__(41).f, toString = {}.toString, windowNames = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(it) {
var toIObject = __webpack_require__(7), gOPN = __webpack_require__(41).f, toString = {}.toString, windowNames = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(it) {
try {

@@ -1170,13 +1173,13 @@ return gOPN(it);

};
}, /* 79 */
}, /* 78 */
/***/
function(module, exports) {}, /* 80 */
function(module, exports) {}, /* 79 */
/***/
function(module, exports, __webpack_require__) {
__webpack_require__(26)("asyncIterator");
}, /* 81 */
}, /* 80 */
/***/
function(module, exports, __webpack_require__) {
__webpack_require__(26)("observable");
}, /* 82 */
}, /* 81 */
/***/

@@ -1191,3 +1194,3 @@ function(module, exports, __webpack_require__) {

exports.__esModule = !0;
var _setPrototypeOf = __webpack_require__(83), _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf), _create = __webpack_require__(87), _create2 = _interopRequireDefault(_create), _typeof2 = __webpack_require__(35), _typeof3 = _interopRequireDefault(_typeof2);
var _setPrototypeOf = __webpack_require__(82), _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf), _create = __webpack_require__(86), _create2 = _interopRequireDefault(_create), _typeof2 = __webpack_require__(35), _typeof3 = _interopRequireDefault(_typeof2);
exports.default = function(subClass, superClass) {

@@ -1205,22 +1208,22 @@ if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === superClass ? "undefined" : (0,

};
}, /* 83 */
}, /* 82 */
/***/
function(module, exports, __webpack_require__) {
module.exports = {
default: __webpack_require__(84),
default: __webpack_require__(83),
__esModule: !0
};
}, /* 84 */
}, /* 83 */
/***/
function(module, exports, __webpack_require__) {
__webpack_require__(85), module.exports = __webpack_require__(1).Object.setPrototypeOf;
}, /* 85 */
__webpack_require__(84), module.exports = __webpack_require__(1).Object.setPrototypeOf;
}, /* 84 */
/***/
function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(6);
var $export = __webpack_require__(5);
$export($export.S, "Object", {
setPrototypeOf: __webpack_require__(86).set
setPrototypeOf: __webpack_require__(85).set
});
}, /* 86 */
}, /* 85 */
/***/

@@ -1248,13 +1251,13 @@ function(module, exports, __webpack_require__) {

};
}, /* 87 */
}, /* 86 */
/***/
function(module, exports, __webpack_require__) {
module.exports = {
default: __webpack_require__(88),
default: __webpack_require__(87),
__esModule: !0
};
}, /* 88 */
}, /* 87 */
/***/
function(module, exports, __webpack_require__) {
__webpack_require__(89);
__webpack_require__(88);
var $Object = __webpack_require__(1).Object;

@@ -1264,11 +1267,11 @@ module.exports = function(P, D) {

};
}, /* 89 */
}, /* 88 */
/***/
function(module, exports, __webpack_require__) {
var $export = __webpack_require__(6);
var $export = __webpack_require__(5);
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, "Object", {
create: __webpack_require__(22)
create: __webpack_require__(21)
});
} ]);
});
{
"name": "react-error-boundary",
"version": "1.0.0",
"version": "1.1.0",
"description": "Sample reusable React error boundary component for React 16+",

@@ -20,2 +20,3 @@ "files": [

"lint": "eslint 'src/**/*.js'",
"prettier": "prettier --config .prettierrc --write \"src/**/*.js\"",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -27,2 +28,5 @@ },

"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.1",
"babel-plugin-flow-react-proptypes": "^3.4.2",

@@ -36,18 +40,22 @@ "babel-plugin-transform-react-remove-prop-types": "^0.4.6",

"babel-preset-stage-1": "^6.24.1",
"babel-runtime": "^6.23.0",
"cross-env": "^5.0.1",
"eslint": "^4.2.0",
"flow-cli": "^0.0.0-pre",
"rimraf": "^2.6.1"
},
"dependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-runtime": "^6.23.0",
"eslint-config-fbjs": "^2.0.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-flowtype": "^2.39.1",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-relay": "^0.0.19",
"flow-bin": "^0.57.3",
"prettier": "^1.7.4",
"prop-types": "^15.5.10",
"rimraf": "^2.6.1",
"webpack": "^3.3.0"
},
"peerDependencies": {
"react": "^16.0.0-alpha.13",
"react-dom": "^16.0.0-alpha.13"
"react": "^16.0.0-beta.1",
"react-dom": "^16.0.0-beta.1"
}
}
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