// @ts-nocheck import { Box, Flex, Heading, Image } from "@chakra-ui/core"; import React from "react"; import { AiOutlineReload } from "react-icons/ai"; import errorGirl from "./assets/error_girl.png"; type HocProps = { // here you can extend hoc with new props }; type HocState = { readonly error: Error | null | undefined; }; class ErrorBoundary extends React.Component { readonly state: HocState = { error: null, }; componentDidCatch(error: Error | null, errorInfo: object) { this.setState({ error: error }); } render() { if (this.state.error) { if (this.state.error.message.includes("Loading chunk")) { return ( New version of sendou.ink has been released! Click the icon below to reload the page and start using the newest version. window.location.reload(false)} /> ); } return ( An error occurred:{" "} {this.state.error.message} If you let me know on{" "} GitHub ,{" "} Discord {" "} or{" "} Twitter {" "} I can do my best to get the problem fixed!
            {this.state.error.stack}
          
); } return this.props.children; } } export default ErrorBoundary;