Skip to content

Commit

Permalink
fix: check whether oldDom is present in the DOM (#4318)
Browse files Browse the repository at this point in the history
* leverage isConnected

* expect ts error
  • Loading branch information
JoviDeCroock authored Apr 5, 2024
1 parent 3a1b19a commit 7fbf03f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/diff/children.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export function diffChildren(
childVNode._flags & INSERT_VNODE ||
oldVNode._children === childVNode._children
) {
if (!newDom && oldVNode._dom == oldDom) {
// @ts-expect-error olDom should be present on a DOM node
if (oldDom && !oldDom.isConnected) {
oldDom = getDomSibling(oldVNode);
}
oldDom = insert(childVNode, oldDom, parentDom);
Expand Down

0 comments on commit 7fbf03f

Please sign in to comment.