import * as React from 'react'; export default class ErrorBoundary extends React.Component { state:any = { error: null, errorInfo: null }; componentDidCatch(error:any, errorInfo:any) { this.setState({ error: error, errorInfo: errorInfo }); } render() { if (this.state.error) { try { const output = []; output.push(
{this.state.error.message}
); if (this.state.error.stack) { output.push({this.state.error.stack}); } if (this.state.errorInfo) { if (this.state.errorInfo.componentStack) { output.push(
{this.state.errorInfo.componentStack}); } } return (
Joplin encountered a fatal error and could not continue. To report the error, please copy the *entire content* of this page and post it on Joplin forum or GitHub.
{output}