- github:https://github.com/securingsincity/react-ace
- star : 3.6k
- npm : weekly downloads 280,045
- DEMO of React Ace: https://securingsincity.github.io/react-ace/
- install
npm install react-ace ace-builds
// or
yarn add react-ace ace-builds
- Basic Usage
import React from "react";
import { render } from "react-dom";
import AceEditor from "react-ace";
import "ace-builds/src-noconflict/mode-java";
import "ace-builds/src-noconflict/theme-github";
import "ace-builds/src-noconflict/ext-language_tools";
function onChange(newValue) {
console.log("change", newValue);
}
// Render editor
render(
<AceEditor
mode="java"
theme="github"
onChange={onChange}
name="UNIQUE_ID_OF_DIV"
editorProps={{ $blockScrolling: true }}
/>,
document.getElementById("example")
);
标签:github,builds,ace,react,编辑器,import,noconflict
From: https://www.cnblogs.com/Running00/p/16741488.html