Handle React exception when a function is provided (#5016)

This commit is contained in:
Gabriel Dutra 2020-07-01 22:53:42 -03:00 committed by GitHub
parent 217f41b586
commit a7edbf1e8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,9 @@ export default class ErrorBoundary extends React.Component {
handleError = error => {
this.setState(this.constructor.getDerivedStateFromError(error));
this.componentDidCatch(error, null);
if (isFunction(window.handleException)) {
window.handleException(error);
}
};
reset = () => {