Use this.getDOMNode() instead of last argument of componentDidMount

This commit is contained in:
Christopher Chedeau
2013-11-20 14:18:49 -08:00
committed by Paul O’Shannessy
parent 934ef1d4c2
commit a23d43bf05
4 changed files with 7 additions and 7 deletions
@@ -132,7 +132,7 @@ var ReactTransitionableChild = React.createClass({
}
},
componentDidMount: function(node) {
componentDidMount: function() {
if (this.props.enter) {
this.transition('enter');
}
+2 -2
View File
@@ -46,8 +46,8 @@ describe('ReactDOM', function() {
render: function() {
return <form><input type="submit" value="Submit" /></form>;
},
componentDidMount: function(node) {
form = node;
componentDidMount: function() {
form = this.getDOMNode();
}
});
var instance = ReactTestUtils.renderIntoDocument(<Parent />);
+2 -2
View File
@@ -40,11 +40,11 @@ var ReactDOMForm = ReactCompositeComponent.createClass({
return this.transferPropsTo(form(null, this.props.children));
},
componentDidMount: function(node) {
componentDidMount: function() {
ReactEventEmitter.trapBubbledEvent(
EventConstants.topLevelTypes.topSubmit,
'submit',
node
this.getDOMNode()
);
}
});
+2 -2
View File
@@ -81,8 +81,8 @@ var ReactDOMInput = ReactCompositeComponent.createClass({
return input(props, this.props.children);
},
componentDidMount: function(rootNode) {
var id = ReactMount.getID(rootNode);
componentDidMount: function() {
var id = ReactMount.getID(this.getDOMNode());
instancesByReactID[id] = this;
},