Skip to content

Commit

Permalink
fix(customProptypes): add a check for Element existance (#3965)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter committed Jun 23, 2020
1 parent 478af65 commit e71b0a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/customPropTypes.js
Expand Up @@ -10,6 +10,8 @@ const typeOf = (...args) => Object.prototype.toString.call(...args)
export const domNode = (props, propName) => {
// skip if prop is undefined
if (props[propName] === undefined) return
// short circle for SSR env
if (typeof Element === 'undefined') return
// skip if prop is valid
if (props[propName] instanceof Element) return

Expand Down

0 comments on commit e71b0a1

Please sign in to comment.