Skip to content

v3.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 29 Nov 03:46
· 10 commits to main since this release

Buy me a coffee npm bundle size

Documentation v3.0.0: https://raw.githack.com/uiwjs/react-textarea-code-editor/fd37bcf/index.html
Comparing Changes: v2.1.9...v3.0.0

npm i @uiw/react-textarea-code-editor@3.0.0

Remove Code Highlight

The following example can help you exclude code highlighting code from being included in the bundle. @uiw/react-textarea-code-editor/nohighlight component does not contain the rehype-prism-plus code highlighting package.

import React, { useState } from "react";
import CodeEditor from '@uiw/react-textarea-code-editor/nohighlight';

export default function App() {
  const [code, setCode] = useState(
    `function add(a, b) {\n  return a + b;\n}`
  );
  return (
    <CodeEditor
      value={code}
      language="js"
      placeholder="Please enter JS code."
      onChange={(evn) => setCode(evn.target.value)}
      padding={15}
      style={{
        backgroundColor: "#f5f5f5",
        fontFamily: 'ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace',
      }}
    />
  );
}