Skip to Content
✨ Svelte Flow 1.0 is here! Rewritten for Svelte 5 with many new features and improvements.
ReferenceHooksuseNodesData()

useNodesData()

Source on GitHub 

With this hook you can receive the data of the passed node ids.

<script lang="ts"> import { useNodesData } from '@xyflow/svelte'; const nodeData = useNodesData(['node-id-a', 'node-id-b']); $effect(() => { // nodeData changes whenever the data of the passed node ids get updated console.log(nodeData.current); }); </script>

Signature

Parameters:
NameTypeDefault
nodeIdstring

The id (or ids) of the node to get the data from

Returns:

An array of data objects

NameType
currentPick<NodeType, "id" | "data" | "type"> | null

Notes

Last updated on