diff --git a/src/CodeEditor.tsx b/src/CodeEditor.tsx index 00769030..350533be 100644 --- a/src/CodeEditor.tsx +++ b/src/CodeEditor.tsx @@ -2,7 +2,7 @@ import noop = require('lodash/noop'); import 'prismjs/components/'; import * as React from 'react'; import { useCallback } from 'react'; -import Editor from 'react-simple-code-editor'; +import ReactSimpleCodeEditor from 'react-simple-code-editor'; import styled from 'styled-components'; import { themeGet } from './utils'; import { highlightCode } from './utils/highlightCode'; @@ -49,17 +49,27 @@ export const supportedLanguages = { ...optionalSupport, }; -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 ( -