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

Function useRemoveCell

packages/joint-react/src/hooks/use-remove-cell.ts:15–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 * ```
14 */
15export function useRemoveCell() {
16 const graph = useGraph();
17 return useCallback(
18 (id: dia.Cell.ID) => {
19 const cell = graph.getCell(id);
20 if (cell) {
21 cell.remove();
22 }
23 },
24 [graph]
25 );
26}
27/**
28 * A custom hook that removes an element from the graph by its ID.
29 * @group Hooks

Callers 1

Calls 2

useGraphFunction · 0.90
removeMethod · 0.80

Tested by

no test coverage detected