import { Component, type ReactNode } from 'react'; interface Props { children: ReactNode; fallback?: ReactNode; } interface State { hasError: boolean; } export class SectionErrorBoundary extends Component { state: State = { hasError: false }; static getDerivedStateFromError() { return { hasError: true }; } componentDidCatch(error: Error) { console.error('[SectionErrorBoundary]', error.message, error.stack); } render() { if (this.state.hasError) { return this.props.fallback ?? (

섹션 렌더링 오류 (콘솔 확인)

); } return this.props.children; } }