Skip to content

Commit c10b3f7

Browse files
alireza-molaeerickhanlonii
authored andcommitted
Fix false positive warning about react-dom/client with UMD builds (#24274)
1 parent d404d96 commit c10b3f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-dom/src/client/ReactDOM.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function createRoot(
152152
options?: CreateRootOptions,
153153
): RootType {
154154
if (__DEV__) {
155-
if (!Internals.usingClientEntryPoint) {
155+
if (!Internals.usingClientEntryPoint && !__UMD__) {
156156
console.error(
157157
'You are importing createRoot from "react-dom" which is not supported. ' +
158158
'You should instead import it from "react-dom/client".',
@@ -168,7 +168,7 @@ function hydrateRoot(
168168
options?: HydrateRootOptions,
169169
): RootType {
170170
if (__DEV__) {
171-
if (!Internals.usingClientEntryPoint) {
171+
if (!Internals.usingClientEntryPoint && !__UMD__) {
172172
console.error(
173173
'You are importing hydrateRoot from "react-dom" which is not supported. ' +
174174
'You should instead import it from "react-dom/client".',

0 commit comments

Comments
 (0)