diff --git a/.changeset/real-pugs-guess.md b/.changeset/real-pugs-guess.md new file mode 100644 index 00000000..dce23e89 --- /dev/null +++ b/.changeset/real-pugs-guess.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": minor +--- + +Remove `null` as possible return type of data in `useNodesData` diff --git a/packages/core/src/composables/useNodesData.ts b/packages/core/src/composables/useNodesData.ts index 9c1e8ca2..337beb1a 100644 --- a/packages/core/src/composables/useNodesData.ts +++ b/packages/core/src/composables/useNodesData.ts @@ -7,7 +7,7 @@ import { useVueFlow } from './useVueFlow' interface NodeData { id: string type: NodeType['type'] - data: NonNullable | null + data: NonNullable } /** @@ -42,7 +42,7 @@ export function useNodesData(_nodeIds: any): any { return { id: node.id, type: node.type, - data: node.data ?? null, + data: node.data, } } @@ -58,7 +58,7 @@ export function useNodesData(_nodeIds: any): any { data.push({ id: node.id, type: node.type, - data: node.data ?? null, + data: node.data, }) } }