MCPcopy Create free account
hub / github.com/uiwjs/react-codemirror / refCallack

Function refCallack

www/src/pages/examples/ExampleRef.tsx:7–13  ·  view source on GitHub ↗
(editor: ReactCodeMirrorRef)

Source from the content-addressed store, hash-verified

5export function Component() {
6 let $edit = useRef<ReactCodeMirrorRef | null>(null);
7 function refCallack(editor: ReactCodeMirrorRef) {
8 if (!$edit.current && editor?.editor && editor?.state && editor?.view) {
9 // first time we got ref, similar to useEffect
10 console.log(editor); // do something with editor
11 $edit.current = editor; // store it
12 }
13 }
14 return (
15 <div>
16 <CodeMirror

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…