diff --git a/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js b/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js index dbdb6d718dad6..de109ffc33d09 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js +++ b/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js @@ -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 tag.', + type, + ); + } + } + return true; + } case 'template': case 'style': { if (__DEV__) { @@ -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;