File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,15 +3,13 @@ import ReactDOM from 'react-dom';
33import PropTypes from 'prop-types' ;
44import ModalPortal from './ModalPortal' ;
55import * as ariaAppHider from '../helpers/ariaAppHider' ;
6- import SafeHTMLElement from '../helpers/safeHTMLElement' ;
6+ import SafeHTMLElement , {
7+ canUseDOM
8+ } from '../helpers/safeHTMLElement' ;
79
810export const portalClassName = 'ReactModalPortal' ;
911export const bodyOpenClassName = 'ReactModal__Body--open' ;
1012
11- const canUseDOM = typeof window !== 'undefined' &&
12- typeof document !== 'undefined' &&
13- typeof document . createElement === 'function' ;
14-
1513const isReact16 = ReactDOM . createPortal !== undefined ;
1614const createPortal = isReact16 ?
1715 ReactDOM . createPortal :
Original file line number Diff line number Diff line change @@ -4,4 +4,6 @@ const EE = ExecutionEnvironment;
44
55const SafeHTMLElement = EE . canUseDOM ? window . HTMLElement : { } ;
66
7+ export const canUseDOM = EE . canUseDOM ;
8+
79export default SafeHTMLElement ;
You can’t perform that action at this time.
0 commit comments