Skip to main content

current working flow:

downgrade react-scripts@4.0.3

initiate highlighter

const monacoJSXHighlighter = new MonacoJSXHighlighter(
monaco, babel, traverse, aMonacoEditor()
);
// Activate highlighting (debounceTime default: 100ms)
monacoJSXHighlighter.highlightOnDidChangeModelContent(100);
// Activate JSX commenting
monacoJSXHighlighter.addJSXCommentCommand();



function aMonacoEditor() {
return monaco.editor.create(
document.getElementById("editor"), {
value: 'const AB=<A x={d}\><B\>{"hello"}</B\></A\>;',
language: 'javascript'
});
}

References