Reference
OnEdgesChange

OnEdgesChange

This type is used for typing the onEdgesChange function.

export type OnEdgesChange<EdgeType extends Edge = Edge> = (
  changes: EdgeChange<EdgeType>[],
) => void;

Fields

#changes

Usage

This type accepts a generic type argument of custom edge types. See this section in our Typescript guide for more information.

const onEdgesChange: OnEdgesChange = useCallback(
  (changes) => setEdges((eds) => applyEdgeChanges(changes, eds)),
  [setEdges],
);