Log component stack if a component crashes
Summary: Currently, component crashes are missing component stack traces. Without them, crash bot reports are impossible to debug. Reviewed By: ivanmisuno Differential Revision: D44331421 fbshipit-source-id: 0ebd160b4f2f64db40dae29dd9fc350d8d28d802
This commit is contained in:
committed by
Facebook GitHub Bot
parent
baf4354136
commit
ccbc4770f5
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import {CodeBlock} from 'flipper-plugin';
|
||||
import {Component} from 'react';
|
||||
import {Component, ErrorInfo} from 'react';
|
||||
import Heading from './Heading';
|
||||
import Button from './Button';
|
||||
import View from './View';
|
||||
@@ -54,8 +54,8 @@ export default class ErrorBoundary extends Component<
|
||||
this.state = {error: null};
|
||||
}
|
||||
|
||||
componentDidCatch(err: Error) {
|
||||
console.error(err.toString(), 'ErrorBoundary');
|
||||
componentDidCatch(err: Error, errorInfo: ErrorInfo) {
|
||||
console.error(err.toString(), errorInfo.componentStack, 'ErrorBoundary');
|
||||
this.setState({error: err});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user