OnEdgesChange
这种类型用于为 onEdgesChange 函数进行类型定义。
🌐 This type is used for typing the onEdgesChange function.
export type OnEdgesChange<EdgeType extends Edge = Edge> = (
changes: EdgeChange<EdgeType>[],
) => void;字段
🌐 Fields
Parameters:| Name | Type | Default |
|---|---|---|
changes | EdgeChange<EdgeType>[] |
用法
🌐 Usage
这种类型接受自定义边类型的泛型类型参数。有关更多信息,请参阅我们 Typescript 指南中的本节。
🌐 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