Question · JavaScript and React course · Module 10: React Ecosystem and Future

Error Boundary and Suspense

What is the relationship between Error Boundary and Suspense in modern React?

Answer options

  • Suspense handles loading states, and Error Boundary catches errors - together they cover the full cycle of asynchronous operations
  • They are identical - Error Boundary and Suspense do the same thing
  • Error Boundary replaced Suspense in React 18
  • Suspense is a newer version of Error Boundary and they should not be used together

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