componentDidCatch와 동등한 리액트 훅? 리액트 앱에서 오류 경계로 기능하는 간단한 컴포넌트가 있으며, 이 컴포넌트는 에러를 로깅 서비스로 전달합니다. 다음과 같습니다. export class CatchError extends React.PureComponent { state = { hasError: false } componentDidCatch(error, info) { this.props.log({ error, info }) this.setState({ hasError: true }) } render() { const child = typeof this.props.children === "function" ? this.props.children({ error: hasError }) : c..