Skip to content

Commit

Permalink
Fix bug report with-portals example vercel#5694
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylsepeda committed Nov 20, 2018
1 parent 76202f2 commit af494a4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions examples/with-portals/components/Portal.js
Expand Up @@ -4,13 +4,10 @@ import ReactDOM from 'react-dom'
export class Portal extends React.Component {
componentDidMount () {
this.element = document.querySelector(this.props.selector)
this.forceUpdate()
}

render () {
if (this.element === undefined) {
return null
}

return ReactDOM.createPortal(this.props.children, this.element)
}
}

0 comments on commit af494a4

Please sign in to comment.