From 5c59b9fc4969c7eb7591acbc1be7de69420e77a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Elsd=C3=B6rfer?= Date: Mon, 12 Oct 2015 10:46:24 +0330 Subject: [PATCH] Use renderSubtreeIntoContainer to keep context. --- lib/components/Modal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/components/Modal.js b/lib/components/Modal.js index 3d566b50..49f0a86c 100644 --- a/lib/components/Modal.js +++ b/lib/components/Modal.js @@ -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 : {}; @@ -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 () {