From 0c0539100386511a4e70870ad01dd1a6448af829 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sat, 15 Jun 2024 13:08:21 +0200 Subject: [PATCH] optimize by not accessing the dom --- src/diff/children.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diff/children.js b/src/diff/children.js index 36c5be0c9d..1be966d1e8 100644 --- a/src/diff/children.js +++ b/src/diff/children.js @@ -117,7 +117,7 @@ export function diffChildren( oldVNode._children === childVNode._children ) { // @ts-expect-error olDom should be present on a DOM node - if (oldDom && oldDom.nodeType === 1 && !oldDom.isConnected) { + if (oldDom && typeof childVNode.type == 'string' && !oldDom.isConnected) { oldDom = getDomSibling(oldVNode); } oldDom = insert(childVNode, oldDom, parentDom);