Can you describe the componentDidCatch lifecycle method signature?
- componentDidCatch(error: Error, errorInfo: object)
- componentDidCatch(error: string, errorInfo: object)
- componentDidCatch(error: Error, errorInfo: string)
- componentDidCatch(error: string, errorInfo: string)
The componentDidCatch lifecycle method is called whenever an error is thrown in a component's child tree. The method has a signature of componentDidCatch(error: Error, errorInfo: object). The error parameter is the actual error object that was thrown, while the errorInfo parameter is an object that contains additional information about the error, such as the component stack trace.
Loading...