|
|
@ -9,7 +9,7 @@ export const Editor: VFC = () => {
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
if (monacoEl) {
|
|
|
|
if (monacoEl) {
|
|
|
|
setEditor((editor) => {
|
|
|
|
setEditor((editor) => {
|
|
|
|
if (editor) return;
|
|
|
|
if (editor) return editor;
|
|
|
|
|
|
|
|
|
|
|
|
return monaco.editor.create(monacoEl.current!, {
|
|
|
|
return monaco.editor.create(monacoEl.current!, {
|
|
|
|
value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
|
|
|
|
value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
|
|
|
|