From 507096d184803f2ba79d485ac0a20741d04ef55e Mon Sep 17 00:00:00 2001 From: alireza molaee Date: Tue, 5 Apr 2022 06:26:18 +0430 Subject: [PATCH] Fix false positive warning about react-dom/client with UMD builds (#24274) --- packages/react-dom/src/client/ReactDOM.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/client/ReactDOM.js b/packages/react-dom/src/client/ReactDOM.js index 1d78dc08dea92..9ec6f67cbd7d7 100644 --- a/packages/react-dom/src/client/ReactDOM.js +++ b/packages/react-dom/src/client/ReactDOM.js @@ -149,7 +149,7 @@ function createRoot( options?: CreateRootOptions, ): RootType { if (__DEV__) { - if (!Internals.usingClientEntryPoint) { + if (!Internals.usingClientEntryPoint && !__UMD__) { console.error( 'You are importing createRoot from "react-dom" which is not supported. ' + 'You should instead import it from "react-dom/client".', @@ -165,7 +165,7 @@ function hydrateRoot( options?: HydrateRootOptions, ): RootType { if (__DEV__) { - if (!Internals.usingClientEntryPoint) { + if (!Internals.usingClientEntryPoint && !__UMD__) { console.error( 'You are importing hydrateRoot from "react-dom" which is not supported. ' + 'You should instead import it from "react-dom/client".',