Skip to content

Commit

Permalink
fix(Portal): make compatible with React Fiber (#1470)
Browse files Browse the repository at this point in the history
fix(Portal): make compatible with React Fiber
  • Loading branch information
cpunion authored and levithomason committed Mar 16, 2017
1 parent 562e769 commit f69d6bf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/addons/Portal/Portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,14 @@ class Portal extends Component {
ReactDOM.unstable_renderSubtreeIntoContainer(
this,
Children.only(children),
this.rootNode
)

this.portalNode = this.rootNode.firstElementChild
this.rootNode,
() => {
this.portalNode = this.rootNode.firstElementChild

this.portalNode.addEventListener('mouseleave', this.handlePortalMouseLeave)
this.portalNode.addEventListener('mouseenter', this.handlePortalMouseEnter)
this.portalNode.addEventListener('mouseleave', this.handlePortalMouseLeave)
this.portalNode.addEventListener('mouseenter', this.handlePortalMouseEnter)
}
)
}

mountPortal = () => {
Expand Down

0 comments on commit f69d6bf

Please sign in to comment.