diff --git a/compat/src/portals.js b/compat/src/portals.js index c480a3d3a3..4cdeff370e 100644 --- a/compat/src/portals.js +++ b/compat/src/portals.js @@ -39,7 +39,6 @@ function Portal(props) { nodeType: 1, parentNode: container, childNodes: [], - contains: () => true, // Technically this isn't needed appendChild(child) { this.childNodes.push(child); diff --git a/src/diff/children.js b/src/diff/children.js index 5053a51174..7938e302e3 100644 --- a/src/diff/children.js +++ b/src/diff/children.js @@ -339,7 +339,7 @@ function insert(parentVNode, oldDom, parentDom) { return oldDom; } else if (parentVNode._dom != oldDom) { - if (oldDom && parentVNode.type && !parentDom.contains(oldDom)) { + if (oldDom && parentVNode.type && !oldDom.parentNode) { oldDom = getDomSibling(parentVNode); } parentDom.insertBefore(parentVNode._dom, oldDom || null); diff --git a/src/index.d.ts b/src/index.d.ts index 287d575c53..51321916f9 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -289,7 +289,6 @@ interface ContainerNode { readonly firstChild: ContainerNode | null; readonly childNodes: ArrayLike; - contains(other: ContainerNode | null): boolean; insertBefore(node: ContainerNode, child: ContainerNode | null): ContainerNode; appendChild(node: ContainerNode): ContainerNode; removeChild(child: ContainerNode): ContainerNode;