import React, { Component, ErrorInfo, ReactNode } from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; class ErrorBoundary extends Component<{ children: ReactNode }, { hasError: boolean; error: Error | null }> { constructor(props: { children: ReactNode }) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: Error) { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error("Uncaught error:", error, errorInfo); } render() { if (this.state.hasError) { return (
We dropped the lollipop. Something went wrong while loading the shop.
Error Details:
{this.state.error?.message || "Unknown error"}