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