Skip to content

v4.4.1

Compare
Choose a tag to compare
@github-actions github-actions released this 16 Feb 08:03
· 513 commits to master since this release


v4.4.0...v4.4.1

Example:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <script src="https://unpkg.com/[email protected]/umd/react.development.js" crossorigin></script>
  <script src="https://unpkg.com/[email protected]/umd/react-dom.development.js" crossorigin></script>
  <script src="https://codemirror.net/6/codemirror.js"></script>
  <script src="https://unpkg.com/@uiw/[email protected]/dist/codemirror.min.js"></script>
</head>
<body>
  <div id="container" style="padding: 24px"></div>
  <script>
    const {javascript} = CM["@codemirror/lang-javascript"];
    const ReactCodeMirror = codemirror.default;
    const e = React.createElement;
    const Demo = () => {
      return e('div', {},
        e(ReactCodeMirror, {
          value: console.log('hello world!'),
          height: '200px',
          extensions: [javascript({ jsx: true })],
          onChange: (value, viewUpdate) => {
            console.log('value:', value);
          }
        })
      );
    }

    ReactDOM.render(e(Demo), document.getElementById("container"));
  </script>
</body>
</html>