Skip to content

Commit

Permalink
upgrade react 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
roth1002 committed Oct 16, 2015
1 parent 920d421 commit 496bb0b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 4 additions & 6 deletions lib/components/Modal.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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);
},

Expand All @@ -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 () {
Expand Down
6 changes: 3 additions & 3 deletions lib/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand All @@ -120,7 +120,7 @@ var ModalPortal = module.exports = React.createClass({
},

focusContent: function() {
this.refs.content.getDOMNode().focus();
this.refs.content.focus();
},

closeWithTimeout: function() {
Expand All @@ -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();
},

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 496bb0b

Please sign in to comment.