@samitouri / QOS-React-1 / commits / b75cc078c5

Fix nodeName to UPPERCASE in insertStylesheetIntoRoot (#28255)

## Summary <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> <img width="518" alt="image" src="https://github.com/facebook/react/assets/18693190/6d12df76-7dae-403b-b486-4940992abe8d"> The condition `node.nodeName === 'link'` is always `false`, because `node.nodeName` is Uppercase in specification. And the condition `node.nodeName === 'LINK'` is unnecessary, because Fizz hoists tags when it's `media` attribute is `"not all"`, whether it is a `link` or a `style` (line 36): https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetExternalRuntime.js#L30-L44 https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineSource.js#L30-L44

春希与子晴 committed Sep 14, 2024 at 23:18 UTC b75cc078c5fda0d57135523a7a2f4e8d1536472f
1 file changed +1 -1
packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
+1 -1
@@ -3520,7 +3520,7 @@ function insertStylesheetIntoRoot(
3520 for (let i = 0; i < nodes.length; i++) {
3521 const node = nodes[i];
3522 if (
3523 - node.nodeName === 'link' ||
3523 + node.nodeName === 'LINK' ||
3524 // We omit style tags with media="not all" because they are not in the right position
3525 // and will be hoisted by the Fizz runtime imminently.
3526 node.getAttribute('media') !== 'not all'