reconnectEdge()
既存のEdge
を新しいプロパティで更新する便利なユーティリティです。これは、エッジ配列から一致するid
を持つエッジを検索し、指定した接続でそのプロパティを更新します。
const onReconnect = useCallback(
(oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),
[]
);
署名
名前 | 型 |
---|---|
#パラメーター |
|
# edge | Edge |
# connection | Connection |
# edges | Edge[] |
# options? | object |
# options.shouldReplaceId | boolean |
#戻り値 |
|
Edge[] |