Fix `onHeaders` argument type in `prerenderToNodeStream` docs #8720
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 220 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.323
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8720"
general
weight: 0.35
aurorascharff
The
prerenderToNodeStreamreference saysonHeaders"receives a [Headers] instance". It doesn't. The Node.js stream API passes a plain object with aLinkproperty, the same asrenderToPipeableStream. Only the Web Streams APIs (prerender,renderToReadableStream) wrap the descriptor innew Headers(...).The source is
packages/react-dom/src/server/ReactDOMFizzStaticNode.js.prerenderToNodeStreamtypes the option asonHeaders?: (headers: HeadersDescriptor) => voidand passesoptions.onHeadersstraight through.prerenderin the same file is the one that callsonHeaders(new Headers(headersDescriptor)).The wrong sentence was copied from the Web Streams pages in #8632. This PR swaps in the wording
renderToPipeableStream.mdalready uses for the same callback.Code that follows the current docs and calls
headers.get('Link')throws aTypeError("headers.getis not a function").Test plan
Ran against published
react-dom@19.3.1on Node 24.9.0, with a component that callspreconnect('https://example.com'):yarn lint,yarn tsc,yarn lint-heading-idsandyarn deadlinkspass.