()
| 13 | * ``` |
| 14 | */ |
| 15 | export 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 |
no test coverage detected