Skip to content

Commit e71b0a1

Browse files
authored
fix(customProptypes): add a check for Element existance (#3965)
1 parent 478af65 commit e71b0a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/customPropTypes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const typeOf = (...args) => Object.prototype.toString.call(...args)
1010
export const domNode = (props, propName) => {
1111
// skip if prop is undefined
1212
if (props[propName] === undefined) return
13+
// short circle for SSR env
14+
if (typeof Element === 'undefined') return
1315
// skip if prop is valid
1416
if (props[propName] instanceof Element) return
1517

0 commit comments

Comments
 (0)