Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
import "@babel/polyfill";
import swal from "sweetalert";
import React from "react";
import { render } from "react-dom";
import Main from "./component/Main";
import rule from "../main/rule";
import ace from "ace-builds/src-noconflict/ace";
import "ace-builds/src-noconflict/mode-html";
import "ace-builds/src-noconflict/mode-json";
import "ace-builds/src-noconflict/theme-xcode";
import "ace-builds/src-noconflict/theme-tomorrow";
import "ace-builds/src-noconflict/theme-solarized_light";
ace.config.set("basePath", "/options");
window.onerror = msg => {
swal({
text: msg,
icon: "error"
});
};
render(<main>, document.getElementById("app"));
// Lazy load
rule.load();
</main>
componentDidMount() {
this.editor = ace.edit(this.divRef.current)
const editorRef = this.editor;
ace.config.loadModule("ace/ext/keybinding_menu", function (module) {
module.init(editorRef);
})
if(this.props.onCreate) {
this.props.onCreate(this.editor);
}
this.configureEditor();
this.updateValue();
}