Browse Source

Remove some `getDOMNode` from docs and examples

main
Cheng Lou 10 years ago
parent
commit
6f25cb7b3e
  1. 2
      _js/examples/markdown.js
  2. 4
      _js/live_editor.js

2
_js/examples/markdown.js

@ -6,7 +6,7 @@ var MarkdownEditor = React.createClass({
return {value: 'Type some *markdown* here!'}; return {value: 'Type some *markdown* here!'};
}, },
handleChange: function() { handleChange: function() {
this.setState({value: this.refs.textarea.getDOMNode().value}); this.setState({value: React.findDOMNode(this.refs.textarea).value});
}, },
render: function() { render: function() {
return ( return (

4
_js/live_editor.js

@ -21,7 +21,7 @@ var CodeMirrorEditor = React.createClass({
componentDidMount: function() { componentDidMount: function() {
if (IS_MOBILE) return; if (IS_MOBILE) return;
this.editor = CodeMirror.fromTextArea(this.refs.editor.getDOMNode(), { this.editor = CodeMirror.fromTextArea(React.findDOMNode(this.refs.editor), {
mode: 'javascript', mode: 'javascript',
lineNumbers: this.props.lineNumbers, lineNumbers: this.props.lineNumbers,
lineWrapping: true, lineWrapping: true,
@ -194,7 +194,7 @@ var ReactPlayground = React.createClass({
}, },
executeCode: function() { executeCode: function() {
var mountNode = this.refs.mount.getDOMNode(); var mountNode = React.findDOMNode(this.refs.mount);
try { try {
React.unmountComponentAtNode(mountNode); React.unmountComponentAtNode(mountNode);

Loading…
Cancel
Save