fix error boundary

This commit is contained in:
Erik 2022-11-21 12:50:21 +02:00
parent d228597d0e
commit ae2a4ddbcc
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -8,12 +8,12 @@ class ErrorBoundary extends React.Component {
} }
componentDidCatch(error, errorInfo) { componentDidCatch(error, errorInfo) {
this.sate.error = true; this.setState({error: true});
console.log(error, errorInfo); console.error(error, errorInfo);
} }
render() { 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; return this.props.children;
} }