import * as React from 'react'; class ErrorBoundary extends React.Component { state: { error?: Error; }; constructor(props: any) { super(props); this.state = { }; } componentDidCatch(error: Error, info: any) { this.setState({ error }); } render() { if (this.state.error) { return (
{this.state.error.message}
{this.state.error.stack}