Skip to content

Commit

Permalink
[fixed] check for both window and document.createElement.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed Oct 4, 2017
1 parent 2b835d6 commit d25563c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import SafeHTMLElement from '../helpers/safeHTMLElement';
export const portalClassName = 'ReactModalPortal';
export const bodyOpenClassName = 'ReactModal__Body--open';

const canUseDOM = typeof window !== 'undefined' || (
typeof document !== 'undefined' && document.createElement
);
const canUseDOM = typeof window !== 'undefined' &&
typeof document !== 'undefined' &&
typeof document.createElement === 'function';

const isReact16 = ReactDOM.createPortal !== undefined;
const createPortal = isReact16 ?
Expand Down

0 comments on commit d25563c

Please sign in to comment.