Fix import of ReactDOM in server env
Dan Abramov committed
Sep 4, 2018 at 15:00 UTC
ff93996028acb55b4f76aa11e29eef210a213e20
1 file changed
+2
-1
packages/react-dom/src/client/ReactDOMComponent.js
+2
-1
@@ -11,6 +11,7 @@
11
import {getCurrentFiberOwnerNameInDevOrNull} from 'react-reconciler/src/ReactCurrentFiber';
12
import {registrationNameModules} from 'events/EventPluginRegistry';
13
import warning from 'shared/warning';
14
+import {canUseDOM} from 'shared/ExecutionEnvironment';
15
import warningWithoutStack from 'shared/warningWithoutStack';
16
17
import * as DOMPropertyOperations from './DOMPropertyOperations';
@@ -103,7 +104,7 @@ if (__DEV__) {
104
// normalized. Since it only affects IE, we're skipping style warnings
105
// in that browser completely in favor of doing all that work.
106
// See https://github.com/facebook/react/issues/11807
106
- canDiffStyleForHydrationWarning = !document.documentMode;
107
+ canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
108
109
// HTML parsing normalizes CR and CRLF to LF.
110
// It also can turn \u0000 into \uFFFD inside attributes.