[react-dom] Add reason parameter to browser() - #75426
Merged
eps1lon merged 1 commit intoAug 23, 2026
Merged
Conversation
The runtime browser() API accepts an optional reason of type string | (() => mixed), which the canary type declaration did not yet reflect. The declaration now matches the runtime signature, with Flow's mixed mapped to unknown, and documents that an SSR renderer uses the reason (or the lazy initializer's return value) as the cause of the recoverable error it reports when deferring a subtree to the browser. The tests cover a string reason, a lazy initializer, and reject passing an arbitrary value as the reason. Co-Authored-By: Claude Code (kimi-k3[1m]) <[email protected]>
reason parameter to browser()
eps1lon
marked this pull request as ready for review
August 23, 2026 20:40
Contributor
|
@eps1lon Thank you for submitting this PR! This is a live comment that I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 75426,
"author": "eps1lon",
"headCommitOid": "423db18e2ebd0f7a359ba0e810bbe1069c0300b7",
"mergeBaseOid": "d0fd585aae4cd16131b2ac4a7d380677b1df7e83",
"lastPushDate": "2026-08-23T20:36:01.000Z",
"lastActivityDate": "2026-08-23T20:40:40.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"tooManyCommits": false,
"tooManyReviews": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "react-dom",
"kind": "edit",
"files": [
{
"path": "types/react-dom/canary.d.ts",
"kind": "definition"
},
{
"path": "types/react-dom/test/canary-tests.tsx",
"kind": "test"
}
],
"owners": [
"MartynasZilinskas",
"theruther4d",
"Jessidhia",
"eps1lon"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [],
"mainBotCommentID": 5388351090,
"ciResult": "pass"
} |
Contributor
|
🔔 @MartynasZilinskas @theruther4d @Jessidhia — please review this PR in the next few days. Be sure to explicitly select |
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.
Types for react/react#37241