Skip to content

Commit

Permalink
Use renderSubtreeIntoContainer to keep context.
Browse files Browse the repository at this point in the history
  • Loading branch information
miracle2k committed Oct 19, 2015
1 parent c7153d1 commit 5c59b9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var ExecutionEnvironment = require('exenv');
var ModalPortal = React.createFactory(require('./ModalPortal'));
var ariaAppHider = require('../helpers/ariaAppHider');
var elementClass = require('element-class');
var renderSubtreeIntoContainer = require("react-dom").unstable_renderSubtreeIntoContainer;

var SafeHTMLElement = ExecutionEnvironment.canUseDOM ? window.HTMLElement : {};

Expand Down Expand Up @@ -66,7 +67,7 @@ var Modal = module.exports = React.createClass({
ariaAppHider.toggle(props.isOpen, props.appElement);
}
sanitizeProps(props);
this.portal = ReactDOM.render(ModalPortal(props), this.node);
this.portal = renderSubtreeIntoContainer(this, ModalPortal(props), this.node);
},

render: function () {
Expand Down

0 comments on commit 5c59b9f

Please sign in to comment.