NodeChange
Source on GitHub (opens in a new tab)
The onNodesChange
callback takes
an array of NodeChange
objects that you should use to update your flow's state.
The NodeChange
type is a union of six different object types that represent that
various ways an node can change in a flow.
export type NodeChange =
| NodeDimensionChange
| NodePositionChange
| NodeSelectionChange
| NodeRemoveChange
| NodeAddChange
| NodeResetChange;
Variant types
NodeDimensionChange
Name | Type |
---|---|
# id | string |
# type | "dimensions" |
# dimensions? | Dimensions |
# updateStyle? | boolean |
# resizing? | boolean |
NodePositionChange
Name | Type |
---|---|
# id | string |
# type | "position" |
# position? | |
# positionAbsolute? | |
# dragging? | boolean |
NodeSelectionChange
Name | Type |
---|---|
# id | string |
# type | "select" |
# selected | boolean |
NodeRemoveChange
Name | Type |
---|---|
# id | string |
# type | "remove" |
NodeAddChange<T = any>
Name | Type |
---|---|
# item | Node<T> |
# type | "add" |
NodeResetChange<T = any>
Name | Type |
---|---|
# item | Node<T> |
# type | "reset" |