From ae3640626fcace06851257c48efb488440e489e9 Mon Sep 17 00:00:00 2001 From: William Hilton Date: Tue, 27 Nov 2018 22:21:58 -0500 Subject: [PATCH] fix(code-editor): forward ref to textarea --- src/CodeEditor.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 (
- +
); -}; +}); // @ts-ignore export const CodeEditor = styled(CodeEditorView as any)`