respond-framework
Version:
create as fast you think
34 lines (33 loc) • 799 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _respond = require("respond-framework/modules/replayTools/respond.js");
var React = require("react");
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = {
error: null
};
}
static getDerivedStateFromError(error) {
return {
error
};
}
async componentDidCatch(error, errorInfo) {
console.error(`ReplayTools: there's an error in ReplayTools. Call localStorage.clear() to remove replay settings that may be causing it.`);
}
render() {
const {
error
} = this.state;
const {
children
} = this.props;
return !error ? children : null;
}
}
exports.default = ErrorBoundary;