VisualFlow

Hooks

useReactFlow, useNodesState, useStore, useOnSelectionChange and more.

Version v1 · Updated Oct 31, 2026

useReactFlow

Returns an instance with imperative helpers: getNodes, setNodes, fitView, zoomTo, screenToFlowPosition and toObject.

tsx
const { fitView, screenToFlowPosition } = useReactFlow();

Store hooks

useStore(selector) subscribes to a slice of internal state. Keep selectors narrow to avoid unnecessary renders.