From 4b62e8ee48b902f628827b895a5a8cf9f90a4a25 Mon Sep 17 00:00:00 2001 From: * <8> Date: Wed, 7 Sep 2022 17:52:26 +0800 Subject: [PATCH] Match-id-999bd213135d2e503b18dc8b65ad7e4c7f627294 --- libs/horizon/src/renderer/diff/nodeDiffComparator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/horizon/src/renderer/diff/nodeDiffComparator.ts b/libs/horizon/src/renderer/diff/nodeDiffComparator.ts index 84462e0e..686b0692 100644 --- a/libs/horizon/src/renderer/diff/nodeDiffComparator.ts +++ b/libs/horizon/src/renderer/diff/nodeDiffComparator.ts @@ -71,7 +71,7 @@ function checkCanReuseNode(oldNode: VNode | null, newChild: any, newNodeIdx: num } if (newChild.vtype === TYPE_COMMON_ELEMENT || newChild.vtype === TYPE_PORTAL) { // key存在时用key判断复用 - if (oldKey != null || newChild.key != null) { + if (oldKey !== null || newChild.key !== null) { return oldKey === newChild.key; } else { // 新旧节点的index应该相同才能复用,null会影响位置