You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-dom-bindings/src/client/ReactDOMHostConfig.js
+65-52Lines changed: 65 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -1596,51 +1596,60 @@ export function isHostHoistableType(
1596
1596
namespace=hostContextProd;
1597
1597
}
1598
1598
switch(type){
1599
-
case'meta': {
1600
-
returntrue;
1601
-
}
1599
+
case'meta':
1602
1600
case'title': {
1603
1601
returnnamespace!==SVG_NAMESPACE;
1604
1602
}
1605
1603
case'style': {
1606
-
if(__DEV__){
1607
-
if(outsideHostContainerContext){
1608
-
console.error(
1609
-
'Cannot render a <style> outside the main document without knowing its precedence and a unique href key.'+
1610
-
' React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that'+
1611
-
' does not conflic with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. '+
1612
-
' Note that hoisting <style> tags is considered an advanced feature that most will not use directly.'+
1613
-
' Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`, or move the <style>'+
1614
-
' to the <style> tag.',
1615
-
);
1604
+
if(
1605
+
typeofprops.precedence!=='string'||
1606
+
typeofprops.href!=='string'||
1607
+
props.href===''||
1608
+
namespace===SVG_NAMESPACE
1609
+
){
1610
+
if(__DEV__){
1611
+
if(outsideHostContainerContext){
1612
+
console.error(
1613
+
'Cannot render a <style> outside the main document without knowing its precedence and a unique href key.'+
1614
+
' React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that'+
1615
+
' does not conflic with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. '+
1616
+
' Note that hoisting <style> tags is considered an advanced feature that most will not use directly.'+
1617
+
' Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`, or move the <style>'+
0 commit comments