Skip to Content
You are viewing the v12 docs of React Flow. You can find the latest version here.
ReferenceTypes

OnEdgesChange

This type is used for typing the onEdgesChange function.

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

Fields

Parameters:
NameTypeDefault
changesEdgeChange<EdgeType>[]
Returns:
void

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], );
Last updated on