When an error is caught by an error boundary, which method can be used to render a fallback UI?

  • renderFallbackUI()
  • componentDidCatch()
  • renderErrorUI()
  • renderErrorBoundaryUI()
When an error is caught by an error boundary in React, the method used to render a fallback UI is componentDidCatch(). This lifecycle method allows you to specify how to render a UI when an error is encountered within the component tree. The other options are not standard methods for handling errors in error boundaries.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *