Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit c9daec6

Browse files
committed
Update examples
1 parent 102c93e commit c9daec6

File tree

1 file changed

+2
-4
lines changed
  • examples/feature-apps/monaco-editor/routes

1 file changed

+2
-4
lines changed

examples/feature-apps/monaco-editor/routes/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { useEffect, useRef, useState } from "react";
2-
import type { editor } from "https://esm.sh/[email protected]";
32

43
export default function Index() {
54
const [ready, setReady] = useState(false);
6-
const editorRef = useRef<editor.IStandaloneCodeEditor>();
75
const editorContainerRef = useRef<HTMLDivElement>(null);
86

97
useEffect(() => {
108
(async () => {
119
const { createEditor, createModel } = await import("../lib/editor.ts");
12-
editorRef.current = createEditor(editorContainerRef.current!);
13-
editorRef.current.setModel(createModel("mod.ts", `console.log("Hello, world!");`));
10+
const editor = createEditor(editorContainerRef.current!);
11+
editor.setModel(createModel("mod.ts", `console.log("Hello, world!");`));
1412
setReady(true);
1513
})();
1614
}, []);

0 commit comments

Comments
 (0)