Skip to content

Commit

Permalink
Fix false positive warning about react-dom/client with UMD builds (fa…
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza-molaee authored and zhengjitf committed Apr 15, 2022
1 parent 82d077a commit 507096d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOM.js
Expand Up @@ -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".',
Expand All @@ -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".',
Expand Down

0 comments on commit 507096d

Please sign in to comment.