Skip to content

Commit 496bb0b

Browse files
committed
upgrade react 0.14
1 parent 920d421 commit 496bb0b

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

Diff for: lib/components/Modal.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var React = require('react');
2-
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
2+
var ReactDOM = require('react-dom');
3+
var ExecutionEnvironment = require('exenv');
34
var ModalPortal = React.createFactory(require('./ModalPortal'));
45
var ariaAppHider = require('../helpers/ariaAppHider');
56
var elementClass = require('element-class');
@@ -50,7 +51,7 @@ var Modal = module.exports = React.createClass({
5051
},
5152

5253
componentWillUnmount: function() {
53-
React.unmountComponentAtNode(this.node);
54+
ReactDOM.unmountComponentAtNode(this.node);
5455
document.body.removeChild(this.node);
5556
},
5657

@@ -65,10 +66,7 @@ var Modal = module.exports = React.createClass({
6566
ariaAppHider.toggle(props.isOpen, props.appElement);
6667
}
6768
sanitizeProps(props);
68-
if (this.portal)
69-
this.portal.setProps(props);
70-
else
71-
this.portal = React.render(ModalPortal(props), this.node);
69+
this.portal = ReactDOM.render(ModalPortal(props), this.node);
7270
},
7371

7472
render: function () {

Diff for: lib/components/ModalPortal.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ var ModalPortal = module.exports = React.createClass({
103103
},
104104

105105
open: function() {
106-
focusManager.setupScopedFocus(this.getDOMNode());
106+
focusManager.setupScopedFocus(this.node);
107107
focusManager.markForFocusLater();
108108
this.setState({isOpen: true}, function() {
109109
this.setState({afterOpen: true});
@@ -120,7 +120,7 @@ var ModalPortal = module.exports = React.createClass({
120120
},
121121

122122
focusContent: function() {
123-
this.refs.content.getDOMNode().focus();
123+
this.refs.content.focus();
124124
},
125125

126126
closeWithTimeout: function() {
@@ -142,7 +142,7 @@ var ModalPortal = module.exports = React.createClass({
142142
},
143143

144144
handleKeyDown: function(event) {
145-
if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content.getDOMNode(), event);
145+
if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event);
146146
if (event.keyCode == 27 /*esc*/) this.requestClose();
147147
},
148148

Diff for: package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
"karma-mocha": "0.2.0",
3535
"karma-safari-launcher": "^0.1.1",
3636
"mocha": "2.3.3",
37-
"react": ">=0.13.3",
37+
"exenv": "1.2.0",
38+
"react-addons-test-utils": "^0.14.0",
39+
"react-dom": "^0.14.0",
40+
"react": "^0.14.0",
3841
"reactify": "^1.1.1",
3942
"rf-release": "0.4.0",
4043
"uglify-js": "2.4.24",

0 commit comments

Comments
 (0)