Skip to content

Commit 94ad567

Browse files
Keegan Streetdiasbruno
Keegan Street
authored andcommitted
[fixed] don't access ReactDOM.createPortal if DOM not available
1 parent 421a1c8 commit 94ad567

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/components/Modal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { polyfill } from "react-lifecycles-compat";
1010
export const portalClassName = "ReactModalPortal";
1111
export const bodyOpenClassName = "ReactModal__Body--open";
1212

13-
const isReact16 = ReactDOM.createPortal !== undefined;
13+
const isReact16 = canUseDOM && ReactDOM.createPortal !== undefined;
1414

1515
const getCreatePortal = () =>
1616
isReact16

0 commit comments

Comments
 (0)