Skip to content

Commit 63cde68

Browse files
authored
(chore): copy fix in <style> precedence error (#31524)
## Summary This fixes a typo in the error that gets reported when Float errors while hoisting a style tag that does not contain both `precedence` and `href`. There was a typo in _conflict_ and the last part of the sentence doesn't make sense. I assume it wasn't needed since the message already suggests moving the style tag to the head manually.
1 parent b01722d commit 63cde68

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -3142,10 +3142,9 @@ export function isHostHoistableType(
31423142
console.error(
31433143
'Cannot render a <style> outside the main document without knowing its precedence and a unique href key.' +
31443144
' React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that' +
3145-
' does not conflic with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. ' +
3145+
' does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. ' +
31463146
' Note that hoisting <style> tags is considered an advanced feature that most will not use directly.' +
3147-
' Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`, or move the <style>' +
3148-
' to the <style> tag.',
3147+
' Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.',
31493148
);
31503149
}
31513150
}

packages/react-dom/src/__tests__/ReactDOMFloat-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ describe('ReactDOMFloat', () => {
551551
);
552552
await waitForAll([]);
553553
}).toErrorDev([
554-
'Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflic with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`, or move the <style> to the <style> tag.',
554+
'Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.',
555555
'In HTML, <style> cannot be a child of <html>.',
556556
]);
557557

0 commit comments

Comments
 (0)