/** @jsx jsx */ import { jsx, css } from '@emotion/react' import React, { Component, ErrorInfo, ReactNode } from "react"; interface Props { children: ReactNode; } interface State { hasError: boolean; } // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/error_boundaries/ class ErrorBoundary extends Component { public state: State = { hasError: false }; public static getDerivedStateFromError(_: Error): State { // Update state so the next render will show the fallback UI. return { hasError: true }; } public componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error("Uncaught error:", error, errorInfo); } public render() { if (this.state.hasError) { return

Sorry..there was an error

; } return this.props.children; } } export default ErrorBoundary;