ReferenceHooks

useUpdateNodeInternals

Source on GitHub

When you programmatically add or remove handles to a node or update a node’s handle position, you need to inform Svelte Flow about it by using this hook. This will update the internal dimensions of the node and properly reposition handles on the canvas if necessary.

<script lang="ts">
  import { Handle, useUpdateNodeInternals } from '@xyflow/svelte';
 
  const updateNodeInternals = useUpdateNodeInternals();
</script>

Signature

#Returns
(nodeId: string | string[]) => void
Use this function to update the internal state of one or more nodes that you have changed programmatically.