bananas-commerce-admin
Version:
What's this, an admin for apes?
21 lines • 590 B
JavaScript
import React from "react";
export default class PageErrorBoundary extends React.Component {
state = { error: null };
errorPage;
constructor(props) {
super(props);
this.errorPage = props.errorPage;
}
componentDidCatch(error) {
this.setState({ error });
}
render() {
const { error } = this.state;
if (error) {
const ErrorPage = this.errorPage;
return React.createElement(ErrorPage, { error: error });
}
return this.props.children;
}
}
//# sourceMappingURL=PageErrorBoundary.js.map