File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,13 @@ import ReactDOM from 'react-dom';
3
3
import PropTypes from 'prop-types' ;
4
4
import ModalPortal from './ModalPortal' ;
5
5
import * as ariaAppHider from '../helpers/ariaAppHider' ;
6
- import SafeHTMLElement from '../helpers/safeHTMLElement' ;
6
+ import SafeHTMLElement , {
7
+ canUseDOM
8
+ } from '../helpers/safeHTMLElement' ;
7
9
8
10
export const portalClassName = 'ReactModalPortal' ;
9
11
export const bodyOpenClassName = 'ReactModal__Body--open' ;
10
12
11
- const canUseDOM = typeof window !== 'undefined' &&
12
- typeof document !== 'undefined' &&
13
- typeof document . createElement === 'function' ;
14
-
15
13
const isReact16 = ReactDOM . createPortal !== undefined ;
16
14
const createPortal = isReact16 ?
17
15
ReactDOM . createPortal :
Original file line number Diff line number Diff line change @@ -4,4 +4,6 @@ const EE = ExecutionEnvironment;
4
4
5
5
const SafeHTMLElement = EE . canUseDOM ? window . HTMLElement : { } ;
6
6
7
+ export const canUseDOM = EE . canUseDOM ;
8
+
7
9
export default SafeHTMLElement ;
You can’t perform that action at this time.
0 commit comments