fix error boundary
This commit is contained in:
parent
d228597d0e
commit
ae2a4ddbcc
@ -8,12 +8,12 @@ class ErrorBoundary extends React.Component {
|
||||
}
|
||||
|
||||
componentDidCatch(error, errorInfo) {
|
||||
this.sate.error = true;
|
||||
console.log(error, errorInfo);
|
||||
this.setState({error: true});
|
||||
console.error(error, errorInfo);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.error) return <h1>Something went wrong :(</h1>;
|
||||
if (this.state.error) return <h1>Something went wrong :/</h1>;
|
||||
return this.props.children;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user