Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[react-dom] Add reason parameter to browser() - #75426

Merged
eps1lon merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:sebbie/browser-reason-types
Aug 23, 2026
Merged

[react-dom] Add reason parameter to browser()#75426
eps1lon merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:sebbie/browser-reason-types

Conversation

@eps1lon

@eps1lon eps1lon commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Types for react/react#37241

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]>
@typescript-automation typescript-automation Bot moved this to Needs Author Action in Pull Request Status Board Aug 23, 2026
@eps1lon eps1lon changed the title Add the reason parameter to react-dom's browser() types [react-dom] Add reason parameter to browser() Aug 23, 2026
@eps1lon
eps1lon marked this pull request as ready for review August 23, 2026 20:40
@eps1lon
eps1lon requested a review from Jessidhia as a code owner August 23, 2026 20:40
@typescript-automation

typescript-automation Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@eps1lon Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because 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

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by a DT maintainer

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"
}

@typescript-automation typescript-automation Bot added Critical package Author is Owner The author of this PR is a listed owner of the package. labels Aug 23, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

🔔 @MartynasZilinskas @theruther4d @Jessidhia — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-automation typescript-automation Bot moved this from Needs Author Action to Waiting for Code Reviews in Pull Request Status Board Aug 23, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Aug 23, 2026
@eps1lon
eps1lon merged commit 199564e into DefinitelyTyped:master Aug 23, 2026
4 checks passed
@eps1lon
eps1lon deleted the sebbie/browser-reason-types branch August 23, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author is Owner The author of this PR is a listed owner of the package. Critical package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant