Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize by not accessing the dom
Browse files Browse the repository at this point in the history
JoviDeCroock committed Jun 25, 2024
1 parent e69f7e4 commit 4c114f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diff/children.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 4c114f9

Please sign in to comment.