MCPcopy
hub / github.com/udecode/plate / EditorRefEffect

Function EditorRefEffect

packages/core/src/react/components/EditorRefEffect.tsx:24–48  ·  view source on GitHub ↗
({ id }: { id?: string })

Source from the content-addressed store, hash-verified

22}
23
24export function EditorRefEffect({ id }: { id?: string }) {
25 const store = usePlateStore(id);
26 const editor = useAtomStoreValue(store, 'editor');
27 const setIsMounted = useAtomStoreSet(store, 'isMounted');
28
29 React.useEffect(() => {
30 setIsMounted(true);
31
32 return () => {
33 setIsMounted(false);
34 };
35 }, [setIsMounted]);
36
37 return (
38 <>
39 {editor.meta.pluginCache.useHooks.map((key) => (
40 <EditorRefPluginEffect
41 id={id}
42 key={key}
43 plugin={getPlugin(editor, { key })}
44 />
45 ))}
46 </>
47 );
48}

Callers

nothing calls this directly

Calls 2

usePlateStoreFunction · 0.90
getPluginFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…