MCPcopy
hub / github.com/clientIO/joint / useCreateElement

Function useCreateElement

packages/joint-react/src/hooks/use-create-element.ts:22–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 * ```
21 */
22export function useCreateElement<T extends dia.Element | GraphElement>() {
23 const graph = useGraph();
24 return useCallback(
25 (element: SetElement<T>) => {
26 graph.addCell(processElement(element));
27 },
28 [graph]
29 );
30}

Callers 4

MainFunction · 0.90

Calls 3

useGraphFunction · 0.90
processElementFunction · 0.90
addCellMethod · 0.80

Tested by

no test coverage detected