From 8ae22bdc279206593b64cca5113815e5ee86f886 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Thu, 16 May 2024 23:15:54 -0500 Subject: [PATCH] fix refs in codeEditor.jsx --- shared/naturalcrit/codeEditor/codeEditor.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 <> -
+
; } });