diff --git a/src/CodeEditor.tsx b/src/CodeEditor.tsx index c5ec4a5d..00769030 100644 --- a/src/CodeEditor.tsx +++ b/src/CodeEditor.tsx @@ -49,17 +49,17 @@ export const supportedLanguages = { ...optionalSupport, }; -const CodeEditorView = (props: ICodeEditorProps & { className: string }) => { +const CodeEditorView = React.forwardRef((props: ICodeEditorProps & { className: string }, ref: any) => { const { className, language, onChange = noop, value } = props; const highlightCodeCallback = useCallback(() => highlightCode(value, language), [value, language]); return (