Skip to content

Commit 16aeb9f

Browse files
authored
only check is connected for dom nodes (#4409)
* only check is connected for dom nodes * optimize by not accessing the dom
1 parent 76f5d66 commit 16aeb9f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/diff/children.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ export function diffChildren(
116116
childVNode._flags & INSERT_VNODE ||
117117
oldVNode._children === childVNode._children
118118
) {
119-
// @ts-expect-error olDom should be present on a DOM node
120-
if (oldDom && !parentDom.contains(oldDom)) {
119+
if (
120+
oldDom &&
121+
typeof childVNode.type == 'string' &&
122+
// @ts-expect-error olDom should be present on a DOM node
123+
!parentDom.contains(oldDom)
124+
) {
121125
oldDom = getDomSibling(oldVNode);
122126
}
123127
oldDom = insert(childVNode, oldDom, parentDom);

0 commit comments

Comments
 (0)