useNodes()
This hook returns the current nodes array. When you subscribe, it will trigger whenever
the nodes array changes. This happens when nodes are added, removed, or updated (dragged
for example). The return value exposes a .current property to access the array.
<script lang="ts">
import { useNodes } from '@xyflow/svelte';
const nodes = useNodes();
$inspect(nodes.current);
</script>Signature
Parameters:This function does not accept any parameters.
Returns:A reactive signal of the current nodes
| Name | Type |
|---|---|
current | Node[] |
update | (updateFn: (nodes: Node[]) => Node[]) => void |
set | (nodes: Node[]) => void |
Last updated on