UNPKG

siegel

Version:

Web application development ecosystem

1 lines 393 B
import r from"react";class t extends r.Component{constructor(r){super(r),this.state={err:null}}static ID="-ui-error_boundary";static getDerivedStateFromError(r){return console.error(r),{err:r}}componentDidCatch(){this.props.onError?.(this.state.err)}render(){let{err:r}=this.state,{children:t,getUIErrorText:e}=this.props;return r?e?.(r)||`Error has occured: ${r.message}`:t}}export default t;