From d25563c91a7f41cfc998f0aeaf97bae284962067 Mon Sep 17 00:00:00 2001 From: Bruno Dias Date: Wed, 4 Oct 2017 10:33:20 -0300 Subject: [PATCH] [fixed] check for both window and document.createElement. --- src/components/Modal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Modal.js b/src/components/Modal.js index 9d596304..027669b9 100644 --- a/src/components/Modal.js +++ b/src/components/Modal.js @@ -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 ?