Skip to content

Commit d25563c

Browse files
committedOct 4, 2017
[fixed] check for both window and document.createElement.
1 parent 2b835d6 commit d25563c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

Diff for: ‎src/components/Modal.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import SafeHTMLElement from '../helpers/safeHTMLElement';
88
export const portalClassName = 'ReactModalPortal';
99
export const bodyOpenClassName = 'ReactModal__Body--open';
1010

11-
const canUseDOM = typeof window !== 'undefined' || (
12-
typeof document !== 'undefined' && document.createElement
13-
);
11+
const canUseDOM = typeof window !== 'undefined' &&
12+
typeof document !== 'undefined' &&
13+
typeof document.createElement === 'function';
1414

1515
const isReact16 = ReactDOM.createPortal !== undefined;
1616
const createPortal = isReact16 ?

0 commit comments

Comments
 (0)
Please sign in to comment.