mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Merge pull request #3567 from chenglou/rm-getdomnode
Remove some `getDOMNode` from docs and DOMComponent test
This commit is contained in:
commit
5a3bda983b
3 files changed
+8
-8
No files matched your search
@@ -6,7 +6,7 @@ var MarkdownEditor = React.createClass({
|
||||
return {value: 'Type some *markdown* here!'};
|
||||
},
|
||||
handleChange: function() {
|
||||
this.setState({value: this.refs.textarea.getDOMNode().value});
|
||||
this.setState({value: React.findDOMNode(this.refs.textarea).value});
|
||||
},
|
||||
render: function() {
|
||||
return (
|
||||
|
||||
@@ -21,7 +21,7 @@ var CodeMirrorEditor = React.createClass({
|
||||
componentDidMount: function() {
|
||||
if (IS_MOBILE) return;
|
||||
|
||||
this.editor = CodeMirror.fromTextArea(this.refs.editor.getDOMNode(), {
|
||||
this.editor = CodeMirror.fromTextArea(React.findDOMNode(this.refs.editor), {
|
||||
mode: 'javascript',
|
||||
lineNumbers: this.props.lineNumbers,
|
||||
lineWrapping: true,
|
||||
@@ -194,7 +194,7 @@ var ReactPlayground = React.createClass({
|
||||
},
|
||||
|
||||
executeCode: function() {
|
||||
var mountNode = this.refs.mount.getDOMNode();
|
||||
var mountNode = React.findDOMNode(this.refs.mount);
|
||||
|
||||
try {
|
||||
React.unmountComponentAtNode(mountNode);
|
||||
|
||||
Vendored
+5
-5
@@ -18,17 +18,17 @@ var BootstrapModal = React.createClass({
|
||||
// integrate Bootstrap or jQuery with the components lifecycle methods.
|
||||
componentDidMount: function() {
|
||||
// When the component is added, turn it into a modal
|
||||
$(this.getDOMNode())
|
||||
.modal({backdrop: 'static', keyboard: false, show: false})
|
||||
$(React.findDOMNode(this))
|
||||
.modal({backdrop: 'static', keyboard: false, show: false});
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
$(this.getDOMNode()).off('hidden', this.handleHidden);
|
||||
$(React.findDOMNode(this)).off('hidden', this.handleHidden);
|
||||
},
|
||||
close: function() {
|
||||
$(this.getDOMNode()).modal('hide');
|
||||
$(React.findDOMNode(this)).modal('hide');
|
||||
},
|
||||
open: function() {
|
||||
$(this.getDOMNode()).modal('show');
|
||||
$(React.findDOMNode(this)).modal('show');
|
||||
},
|
||||
render: function() {
|
||||
var confirmButton = null;
|
||||
|
||||
Reference in new issue
Block a user