class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false, error: null, errorInfo: null }; } static getDerivedStateFromError(error) { return { hasError: true }; } componentDidCatch(error, errorInfo) { console.error('🔴 REACT ERROR BOUNDARY CAUGHT:', error); console.error('🔴 ERROR INFO:', errorInfo); console.error('🔴 COMPONENT STACK:', errorInfo.componentStack); this.setState({ error, errorInfo }); } render() { if (this.state.hasError) { return (

⚠️ React Component Error

Error Details (click to expand)
Error:
{this.state.error && this.state.error.toString()}
Stack:
{this.state.error && this.state.error.stack}
Component Stack:
{this.state.errorInfo && this.state.errorInfo.componentStack}
); } return this.props.children; } } if (typeof window !== 'undefined') window.ErrorBoundary = ErrorBoundary;