diff --git a/lib/components/Modal.js b/lib/components/Modal.js index 37da231a..34515094 100644 --- a/lib/components/Modal.js +++ b/lib/components/Modal.js @@ -1,5 +1,6 @@ var React = require('react'); -var ExecutionEnvironment = require('react/lib/ExecutionEnvironment'); +var ReactDOM = require('react-dom'); +var ExecutionEnvironment = require('exenv'); var ModalPortal = React.createFactory(require('./ModalPortal')); var ariaAppHider = require('../helpers/ariaAppHider'); var elementClass = require('element-class'); @@ -50,7 +51,7 @@ var Modal = module.exports = React.createClass({ }, componentWillUnmount: function() { - React.unmountComponentAtNode(this.node); + ReactDOM.unmountComponentAtNode(this.node); document.body.removeChild(this.node); }, @@ -65,10 +66,7 @@ var Modal = module.exports = React.createClass({ ariaAppHider.toggle(props.isOpen, props.appElement); } sanitizeProps(props); - if (this.portal) - this.portal.setProps(props); - else - this.portal = React.render(ModalPortal(props), this.node); + this.portal = ReactDOM.render(ModalPortal(props), this.node); }, render: function () { diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index 06ba9e1b..0e5e4dfb 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -103,7 +103,7 @@ var ModalPortal = module.exports = React.createClass({ }, open: function() { - focusManager.setupScopedFocus(this.getDOMNode()); + focusManager.setupScopedFocus(this.node); focusManager.markForFocusLater(); this.setState({isOpen: true}, function() { this.setState({afterOpen: true}); @@ -120,7 +120,7 @@ var ModalPortal = module.exports = React.createClass({ }, focusContent: function() { - this.refs.content.getDOMNode().focus(); + this.refs.content.focus(); }, closeWithTimeout: function() { @@ -142,7 +142,7 @@ var ModalPortal = module.exports = React.createClass({ }, handleKeyDown: function(event) { - if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content.getDOMNode(), event); + if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event); if (event.keyCode == 27 /*esc*/) this.requestClose(); }, diff --git a/package.json b/package.json index 4205e16c..74128dbb 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,10 @@ "karma-mocha": "0.2.0", "karma-safari-launcher": "^0.1.1", "mocha": "2.3.3", - "react": ">=0.13.3", + "exenv": "1.2.0", + "react-addons-test-utils": "^0.14.0", + "react-dom": "^0.14.0", + "react": "^0.14.0", "reactify": "^1.1.1", "rf-release": "0.4.0", "uglify-js": "2.4.24",