useNodesStore()
import { useNodesStore, type NodesStore } from '@xyflow/react';
export function NodeLookup() {
const nodeLookup = useNodesStore((state: NodesStore) => state.nodeLookup);
return (
<div>
<p>There are {Object.keys(nodeLookup).length} nodes in the flow.</p>
</div>
);
}Signature
Parameters:
This function does not accept any parameters.
Returns:| Name | Type |
|---|---|
nodes | Node<Record<string, unknown>, string | undefined>[] |
nodeLookup | NodeLookup<InternalNode<Node<Record<string, unknown>, string | undefined>>> |
parentLookup | ParentLookup<InternalNode<Node<Record<string, unknown>, string | undefined>>> |
nodesInitialized | boolean |