From 4c114f9119c4b2a27cfbb5b4a44f81a2b740aa6e 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 94f2dd8baa..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 && !parentDom.contains(oldDom)) { + if (oldDom && typeof childVNode.type == 'string' && !oldDom.isConnected) { oldDom = getDomSibling(oldVNode); } oldDom = insert(childVNode, oldDom, parentDom);