Skip to content

Commit b75cc07

Browse files
authored
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
1 parent 3d95c43 commit b75cc07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3520,7 +3520,7 @@ function insertStylesheetIntoRoot(
35203520
for (let i = 0; i < nodes.length; i++) {
35213521
const node = nodes[i];
35223522
if (
3523-
node.nodeName === 'link' ||
3523+
node.nodeName === 'LINK' ||
35243524
// We omit style tags with media="not all" because they are not in the right position
35253525
// and will be hoisted by the Fizz runtime imminently.
35263526
node.getAttribute('media') !== 'not all'

0 commit comments

Comments
 (0)