@samitouri / QOS-React / commits / 1d1fa94a66

Fix false positive warning about react-dom/client with UMD builds (#24274)

alireza molaee committed Apr 5, 2022 at 06:26 UTC 1d1fa94a66275c42b5339dabf9985379a0c74a23
1 file changed +2 -2
packages/react-dom/src/client/ReactDOM.js
+2 -2
@@ -149,7 +149,7 @@ function createRoot(
149 options?: CreateRootOptions,
150 ): RootType {
151 if (__DEV__) {
152 - if (!Internals.usingClientEntryPoint) {
152 + if (!Internals.usingClientEntryPoint && !__UMD__) {
153 console.error(
154 'You are importing createRoot from "react-dom" which is not supported. ' +
155 'You should instead import it from "react-dom/client".',
@@ -165,7 +165,7 @@ function hydrateRoot(
165 options?: HydrateRootOptions,
166 ): RootType {
167 if (__DEV__) {
168 - if (!Internals.usingClientEntryPoint) {
168 + if (!Internals.usingClientEntryPoint && !__UMD__) {
169 console.error(
170 'You are importing hydrateRoot from "react-dom" which is not supported. ' +
171 'You should instead import it from "react-dom/client".',