diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/shared/naturalcrit/codeEditor/codeEditor.jsx index b034d1ca9..4d4a90d0a 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.jsx +++ b/shared/naturalcrit/codeEditor/codeEditor.jsx @@ -63,6 +63,8 @@ const CodeEditor = createClass({ }; }, + editor : React.createRef(null), + componentDidMount : function() { this.buildEditor(); const newDoc = CodeMirror.Doc(this.props.value, this.props.language); @@ -102,7 +104,7 @@ const CodeEditor = createClass({ }, buildEditor : function() { - this.codeMirror = CodeMirror(this.refs.editor, { + this.codeMirror = CodeMirror(this.editor.current, { lineNumbers : true, lineWrapping : this.props.wrap, indentWithTabs : false, @@ -443,7 +445,7 @@ const CodeEditor = createClass({ render : function(){ return <> -
+
; } });