Click in order · JavaScript and React course · Module 16: Error Handling and Suspense

Logging Errors in componentDidCatch

Click elements in order for building error logging in componentDidCatch:

Items to click

  • sendToErrorService(report)
  • report.componentStack = errorInfo.componentStack
  • componentDidCatch(error, errorInfo)
  • const report = { message: error.message }

You can check the correct answer by solving this task in the CodeWorlds game.