From 0e086956e2a28cc51d924d8d362476aac70846cb Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 14 Mar 2024 13:02:34 +0100 Subject: [PATCH] chore(shallowNodeData): cleanup --- packages/react/CHANGELOG.md | 6 ++++++ packages/system/src/utils/shallow-node-data.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 0bc7f603..faaa0a57 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @xyflow/react +## 12.0.0-next.12 + +## Patch changes + +- fix useNodesData: handle invalid node id thanks @saswatax + ## 12.0.0-next.11 ## Patch changes diff --git a/packages/system/src/utils/shallow-node-data.ts b/packages/system/src/utils/shallow-node-data.ts index 42af404e..6bf132b6 100644 --- a/packages/system/src/utils/shallow-node-data.ts +++ b/packages/system/src/utils/shallow-node-data.ts @@ -2,7 +2,7 @@ import { NodeBase } from '../types'; type NodeData = Pick; -export function shallowNodeData(a: NodeData | null | NodeData[], b: NodeData | null | NodeData[]) { +export function shallowNodeData(a: NodeData | NodeData[] | null, b: NodeData | NodeData[] | null) { if (a === null || b === null) { return false; }