()
| 18 | } |
| 19 | |
| 20 | render() { |
| 21 | const { fallback } = this.props; |
| 22 | const { error } = this.state; |
| 23 | if (error) { |
| 24 | if (fallback != null) { |
| 25 | return React.cloneElement(fallback as any, { error }); |
| 26 | } |
| 27 | const errorMsg = `Error: ${error?.message}\n\n${error?.stack}`; |
| 28 | return <pre className="error-boundary">{errorMsg}</pre>; |
| 29 | } else { |
| 30 | return <>{this.props.children}</>; |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | export class NullErrorBoundary extends React.Component< |
no outgoing calls
no test coverage detected