File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 11const React = require ( 'react' ) ;
22const ReactDOM = require ( 'react-dom' ) ;
3- const findDOMNode = ReactDOM . findDOMNode ;
43const PropTypes = require ( 'prop-types' ) ;
54const className = require ( 'classnames' ) ;
65const debounce = require ( 'lodash.debounce' ) ;
@@ -44,9 +43,8 @@ const CodeMirror = createReactClass({
4443 this . componentWillReceiveProps = debounce ( this . componentWillReceiveProps , 0 ) ;
4544 } ,
4645 componentDidMount ( ) {
47- const textareaNode = findDOMNode ( this . refs . textarea ) ;
4846 const codeMirrorInstance = this . getCodeMirrorInstance ( ) ;
49- this . codeMirror = codeMirrorInstance . fromTextArea ( textareaNode , this . props . options ) ;
47+ this . codeMirror = codeMirrorInstance . fromTextArea ( this . textareaNode , this . props . options ) ;
5048 this . codeMirror . on ( 'change' , this . codemirrorValueChanged ) ;
5149 this . codeMirror . on ( 'cursorActivity' , this . cursorActivity ) ;
5250 this . codeMirror . on ( 'focus' , this . focusChanged . bind ( this , true ) ) ;
@@ -118,7 +116,7 @@ const CodeMirror = createReactClass({
118116 return (
119117 < div className = { editorClassName } >
120118 < textarea
121- ref = "textarea"
119+ ref = { ref => this . textareaNode = ref }
122120 name = { this . props . path }
123121 defaultValue = { this . props . value }
124122 autoComplete = "off"
You can’t perform that action at this time.
0 commit comments