Skip to Content
React Flow 13 is here! Read the announcement →
ReferenceTypes

EdgeChange

Source on GitHub 

The onEdgesChange callback takes an array of EdgeChange objects that you should use to update your flow’s state. The EdgeChange type is a union of four different object types that represent that various ways an edge can change in a flow.

export type EdgeChange = | AddChange | RemoveChange | ReplaceChange | SelectionChange;

Variants

AddChange

NameTypeDefault
idstring
itemNodeOrEdge
type"add"
indexnumber

RemoveChange

NameTypeDefault
idstring
type"remove"

ReplaceChange

NameTypeDefault
idstring
itemNodeOrEdge
type"replace"

SelectionChange

NameTypeDefault
idstring
type"select"
selectedboolean