importReactfrom'react';import{Result}from'antd';classErrorBoundaryextendsReact.Component{state={hasError:false,errorInfo:''};staticgetDerivedStateFromError(error){return{hasError:true,errorInfo:error.message};}componentDidCatch(error,errorInfo){// You can also log the error to an error reporting service// eslint-disable-next-line no-consoleconsole.log(error,errorInfo);}render(){if(this.state.hasError){// You can render any custom fallback UIreturn(<Resultstatus="error"title="Something went wrong."extra={this.state.errorInfo}/>);}returnthis.props.children;}}exportdefaultErrorBoundary;