React · Senior · Question 57 of 75
What do the onCaughtError and onUncaughtError options of createRoot (React 19) give you?
- ✓Correct answer: Central hooks to report errors caught by error boundaries and those that weren't caught
- 2Automatic retries of failed renders
- 3A built-in error boundary UI
Explanation
Previously errors were logged twice and reporting needed a custom boundary everywhere. onRecoverableError covers errors React recovered from, such as hydration mismatches.