React · Senior · Question 23 of 75

What happens to an error thrown during render if there's no error boundary above the component?

Explanation

An unhandled render error removes the root's entire UI - showing a broken interface is worse than nothing. In React 19, createRoot has onCaughtError and onUncaughtError for logging. That's why boundaries are placed around routes and independent widgets.

Further reading

Problem with a question

React · Senior · question 23

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