Repository navigation
Conversation
React passes the Error Boundary instance that caught the error as errorInfo.errorBoundary to onCaughtError (since react#28641), but the createRoot and hydrateRoot docs only mentioned componentStack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
errorInfo.errorBoundary in onCaughtError
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
createRootandhydrateRootreference pages say thatonCaughtErrorreceives anerrorInfoobject containing only thecomponentStack. React also passeserrorInfo.errorBoundary: the instance of the Error Boundary that caught the error.This field has been passed since
onCaughtErrorwas introduced in react/react#28641 (React 19). SeeReactFiberErrorLogger.js:Without this, readers of the reference have no way to know that
onCaughtErrorcan tell which Error Boundary handled the error, for example to tag error reports by boundary.This PR mentions
errorBoundaryin theonCaughtErroroption description and in the "Error logging in production" section of both pages. The code example, code blocks, and<CodeStep>highlighting are unchanged.Test plan
Ran against published
react@19.3.1andreact-dom@19.3.1on Node 26.13.0 (jsdom), rendering a class Error Boundary around a component that throws, with anonCaughtErrorcallback passed tocreateRoot:yarn lint,yarn tsc,yarn lint-heading-ids,yarn deadlinksandgit diff --checkpass.🤖 Generated with Claude Code