feat(props): add onNodesDelete and onEdgesDelete handler

This commit is contained in:
moklick
2022-02-20 21:17:59 +01:00
parent f7dd26bb21
commit e011375c3d
6 changed files with 25 additions and 2 deletions
+2
View File
@@ -46,6 +46,8 @@ export interface ReactFlowProps extends HTMLAttributes<HTMLDivElement> {
onNodeDragStart?: (event: ReactMouseEvent, node: Node) => void;
onNodeDrag?: (event: ReactMouseEvent, node: Node) => void;
onNodeDragStop?: (event: ReactMouseEvent, node: Node) => void;
onNodesDelete?: (nodes: Node[]) => void;
onEdgesDelete?: (edges: Edge[]) => void;
onConnect?: OnConnect;
onConnectStart?: OnConnectStart;
onConnectStop?: OnConnectStop;
+3
View File
@@ -164,6 +164,9 @@ export type ReactFlowStore = {
fitViewOnInit: boolean;
fitViewOnInitDone: boolean;
fitViewOnInitOptions: FitViewOptions | undefined;
onNodesDelete?: (nodes: Node[]) => void;
onEdgesDelete?: (edges: Edge[]) => void;
};
export type ReactFlowActions = {