Skip to content

Commit

Permalink
refactor for size
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Oct 24, 2022
1 parent 9b98592 commit bbf5223
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/react-dom-bindings/src/client/ReactDOMFloatClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,18 @@ export function isHostResourceType(type: string, props: Props): boolean {
}
return (async: any) && typeof src === 'string' && !onLoad && !onError;
}
case 'noscript':
case 'noscript': {
if (__DEV__) {
// This is duplicated from the below case because it minifies in prod better
if (resourceFormOnly) {
console.error(
'Cannot render <%s> outside the main document. Try moving it into the root <head> tag.',
type,
);
}
}
return true;
}
case 'template':
case 'style': {
if (__DEV__) {
Expand All @@ -1481,10 +1492,7 @@ export function isHostResourceType(type: string, props: Props): boolean {
);
}
}
// For noscript we want it to be a Resource so we can avoid rendering children.
// In the future we should move this warning to the server and handle it
// separately on the client
return type === 'noscript';
return false;
}
}
return false;
Expand Down

0 comments on commit bbf5223

Please sign in to comment.