Skip to content

Commit bbf5223

Browse files
committed
refactor for size
1 parent 9b98592 commit bbf5223

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,18 @@ export function isHostResourceType(type: string, props: Props): boolean {
14701470
}
14711471
return (async: any) && typeof src === 'string' && !onLoad && !onError;
14721472
}
1473-
case 'noscript':
1473+
case 'noscript': {
1474+
if (__DEV__) {
1475+
// This is duplicated from the below case because it minifies in prod better
1476+
if (resourceFormOnly) {
1477+
console.error(
1478+
'Cannot render <%s> outside the main document. Try moving it into the root <head> tag.',
1479+
type,
1480+
);
1481+
}
1482+
}
1483+
return true;
1484+
}
14741485
case 'template':
14751486
case 'style': {
14761487
if (__DEV__) {
@@ -1481,10 +1492,7 @@ export function isHostResourceType(type: string, props: Props): boolean {
14811492
);
14821493
}
14831494
}
1484-
// For noscript we want it to be a Resource so we can avoid rendering children.
1485-
// In the future we should move this warning to the server and handle it
1486-
// separately on the client
1487-
return type === 'noscript';
1495+
return false;
14881496
}
14891497
}
14901498
return false;

0 commit comments

Comments
 (0)