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

EdgesStore

Source on GitHub 

The edges store is a slice of React Flow’s state returned by the useEdgesStore() hook. It provides convenient lookups for edges by id as well as connections by node id.

import { useEdgesStore, type EdgesStore } from '@xyflow/react'; const edgeCountSelector = (state: EdgesStore) => state.edges.length export function EdgesInspector() { const count = useEdgesStore(edgeCountSelector); return ( <div> <p>There are {count} total edges</p> </div> ); }
NameTypeDefault
edgesEdgeType[]
edgeLookupEdgeLookup<EdgeType>
connectionLookupConnectionLookup