fixed a bug with error boundary persisting between routes

pull/98/head
dperolio 2 years ago
parent 0a5ee2faf7
commit 3dd12b99cc
No known key found for this signature in database
GPG Key ID: 4191689562D51409

@ -26,6 +26,16 @@ export default class ErrorBoundary extends PureComponent {
};
}
/**
*
* @param {object} prevProps Previous props
*/
componentDidUpdate (prevProps) {
if (prevProps.children !== this.props.children) {
this.setState({ hasCrashed: false });
}
}
componentDidCatch (error, info) {
this.setState({ hasCrashed: true });
ReactInvariant.then(invariant => {

Loading…
Cancel
Save