Skip to content

Commit d25563c

Browse files
committed
[fixed] check for both window and document.createElement.
1 parent 2b835d6 commit d25563c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/Modal.js

Lines changed: 3 additions & 3 deletions
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)