Question · JavaScript and React course · Module 16: Error Handling and Suspense

useErrorBoundary Hook

What is the purpose of the useErrorBoundary hook from the react-error-boundary library?

Answer options

  • To programmatically pass errors from event handlers and async code to the nearest Error Boundary
  • To disable Error Boundary in development mode
  • To create an Error Boundary as a function component
  • To automatically log errors to the console

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