Remove some `getDOMNode` from docs and examples
Cheng Lou committed
Apr 2, 2015 at 17:23 UTC
5561d0e9256d6337f24789f14a50ec2beb747f79
3 files changed
+8
-8
docs/_js/examples/markdown.js
+1
-1
@@ -6,7 +6,7 @@ var MarkdownEditor = React.createClass({
6
return {value: 'Type some *markdown* here!'};
7
},
8
handleChange: function() {
9
- this.setState({value: this.refs.textarea.getDOMNode().value});
9
+ this.setState({value: React.findDOMNode(this.refs.textarea).value});
10
},
11
render: function() {
12
return (
docs/_js/live_editor.js
+2
-2
@@ -21,7 +21,7 @@ var CodeMirrorEditor = React.createClass({
21
componentDidMount: function() {
22
if (IS_MOBILE) return;
23
24
- this.editor = CodeMirror.fromTextArea(this.refs.editor.getDOMNode(), {
24
+ this.editor = CodeMirror.fromTextArea(React.findDOMNode(this.refs.editor), {
25
mode: 'javascript',
26
lineNumbers: this.props.lineNumbers,
27
lineWrapping: true,
@@ -194,7 +194,7 @@ var ReactPlayground = React.createClass({
194
},
195
196
executeCode: function() {
197
- var mountNode = this.refs.mount.getDOMNode();
197
+ var mountNode = React.findDOMNode(this.refs.mount);
198
199
try {
200
React.unmountComponentAtNode(mountNode);
examples/jquery-bootstrap/js/app.js
+5
-5
@@ -18,17 +18,17 @@ var BootstrapModal = React.createClass({
18
// integrate Bootstrap or jQuery with the components lifecycle methods.
19
componentDidMount: function() {
20
// When the component is added, turn it into a modal
21
- $(this.getDOMNode())
22
- .modal({backdrop: 'static', keyboard: false, show: false})
21
+ $(React.findDOMNode(this))
22
+ .modal({backdrop: 'static', keyboard: false, show: false});
23
},
24
componentWillUnmount: function() {
25
- $(this.getDOMNode()).off('hidden', this.handleHidden);
25
+ $(React.findDOMNode(this)).off('hidden', this.handleHidden);
26
},
27
close: function() {
28
- $(this.getDOMNode()).modal('hide');
28
+ $(React.findDOMNode(this)).modal('hide');
29
},
30
open: function() {
31
- $(this.getDOMNode()).modal('show');
31
+ $(React.findDOMNode(this)).modal('show');
32
},
33
render: function() {
34
var confirmButton = null;