Skip to content

Commit 1d772af

Browse files
committed
refactor(core): remove null as return type of data in useNodesData (#1575)
* refactor(core): remove `null` as return type of data Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
1 parent 2976b11 commit 1d772af

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/real-pugs-guess.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-flow/core": minor
3+
---
4+
5+
Remove `null` as possible return type of data in `useNodesData`

packages/core/src/composables/useNodesData.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useVueFlow } from './useVueFlow'
77
interface NodeData<NodeType extends Node = GraphNode> {
88
id: string
99
type: NodeType['type']
10-
data: NonNullable<NodeType['data']> | null
10+
data: NonNullable<NodeType['data']>
1111
}
1212

1313
/**
@@ -42,7 +42,7 @@ export function useNodesData(_nodeIds: any): any {
4242
return {
4343
id: node.id,
4444
type: node.type,
45-
data: node.data ?? null,
45+
data: node.data,
4646
}
4747
}
4848

@@ -58,7 +58,7 @@ export function useNodesData(_nodeIds: any): any {
5858
data.push({
5959
id: node.id,
6060
type: node.type,
61-
data: node.data ?? null,
61+
data: node.data,
6262
})
6363
}
6464
}

0 commit comments

Comments
 (0)