Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 484ed14

Browse files
oliviertassinariFezVrasta
authored andcommitted
fix: Dodge SSR issue (#119)
1 parent 79544d7 commit 484ed14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Popper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class Popper extends Component {
2121
modifiers: PropTypes.object,
2222
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
2323
target: PropTypes.oneOfType([
24-
PropTypes.instanceOf(Element),
24+
// the following check is needed for SSR
25+
PropTypes.instanceOf(typeof Element !== 'undefined' ? Element : Object),
2526
PropTypes.shape({
2627
getBoundingClientRect: PropTypes.func.isRequired,
2728
clientWidth: PropTypes.number.isRequired,

0 commit comments

Comments
 (0)