React · Senior · Question 57 of 75

What do the onCaughtError and onUncaughtError options of createRoot (React 19) give you?

Explanation

Previously errors were logged twice and reporting needed a custom boundary everywhere. onRecoverableError covers errors React recovered from, such as hydration mismatches.

Further reading

Problem with a question

React · Senior · question 57

Test yourself

Take the React · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz