Skip to content

Commit ff93996

Browse files
committed
Fix import of ReactDOM in server env
1 parent 281bd64 commit ff93996

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import {getCurrentFiberOwnerNameInDevOrNull} from 'react-reconciler/src/ReactCurrentFiber';
1212
import {registrationNameModules} from 'events/EventPluginRegistry';
1313
import warning from 'shared/warning';
14+
import {canUseDOM} from 'shared/ExecutionEnvironment';
1415
import warningWithoutStack from 'shared/warningWithoutStack';
1516

1617
import * as DOMPropertyOperations from './DOMPropertyOperations';
@@ -103,7 +104,7 @@ if (__DEV__) {
103104
// normalized. Since it only affects IE, we're skipping style warnings
104105
// in that browser completely in favor of doing all that work.
105106
// See https://github.com/facebook/react/issues/11807
106-
canDiffStyleForHydrationWarning = !document.documentMode;
107+
canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
107108

108109
// HTML parsing normalizes CR and CRLF to LF.
109110
// It also can turn \u0000 into \uFFFD inside attributes.

0 commit comments

Comments
 (0)