We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd10612 commit 2b835d6Copy full SHA for 2b835d6
src/components/Modal.js
@@ -8,7 +8,10 @@ import SafeHTMLElement from '../helpers/safeHTMLElement';
8
export const portalClassName = 'ReactModalPortal';
9
export const bodyOpenClassName = 'ReactModal__Body--open';
10
11
-const canUseDOM = typeof window !== undefined;
+const canUseDOM = typeof window !== 'undefined' || (
12
+ typeof document !== 'undefined' && document.createElement
13
+);
14
+
15
const isReact16 = ReactDOM.createPortal !== undefined;
16
const createPortal = isReact16 ?
17
ReactDOM.createPortal :
0 commit comments