фиксы
This commit is contained in:
1 parent
2a8c26c3c6
commit
642a8a9641
13 files changed
+387
-358
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import React, {Component} from "react";
|
||||
|
||||
class ErrorBoundary extends Component {
|
||||
state = {
|
||||
error: null,
|
||||
};
|
||||
|
||||
static getDerivedStateFromError(error) {
|
||||
return {error};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { error } = this.state;
|
||||
|
||||
if (error) {
|
||||
return <div>Что-то пошло не так =( {error}</div>;
|
||||
}
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
|
||||
export default ErrorBoundary
|
||||
Reference in new issue
Block a user