import * as React from 'react'; import styled from '../styled-components'; const ErrorWrapper = styled.div` padding: 20px; color: red; `; export class ErrorBoundary extends React.Component< React.PropsWithChildren, { error?: Error } > { constructor(props) { super(props); this.state = { error: undefined }; } componentDidCatch(error) { this.setState({ error }); return false; } render() { if (this.state.error) { return (

Something went wrong...

{this.state.error.message}

Stack trace
{this.state.error.stack}

ReDoc Version: {__REDOC_VERSION__}
Commit: {__REDOC_REVISION__}
); } return React.Children.only(this.props.children); } }