From e9f9c1c0277bb0ca9e1aa73eb4567a4b160b2e11 Mon Sep 17 00:00:00 2001 From: Sven Kannengiesser Date: Sun, 28 Feb 2021 19:16:04 +0100 Subject: [PATCH] Use node.remove() instead of parent.removeChild(node) --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 6f90a7718..19074398c 100644 --- a/index.js +++ b/index.js @@ -140,7 +140,7 @@ var patch = (parent, node, oldVNode, newVNode, listener, isSvg) => { node ) if (oldVNode != null) { - parent.removeChild(oldVNode.node) + oldVNode.node.remove() } } else { var tmpVKid @@ -227,7 +227,7 @@ var patch = (parent, node, oldVNode, newVNode, listener, isSvg) => { } } else if (newHead > newTail) { while (oldHead <= oldTail) { - node.removeChild(oldVKids[oldHead++].node) + oldVKids[oldHead++].node.remove() } } else { for (var keyed = {}, newKeyed = {}, i = oldHead; i <= oldTail; i++) { @@ -247,7 +247,7 @@ var patch = (parent, node, oldVNode, newVNode, listener, isSvg) => { (newKey != null && newKey === getKey(oldVKids[oldHead + 1])) ) { if (oldKey == null) { - node.removeChild(oldVKid.node) + oldVKid.node.remove() } oldHead++ continue @@ -306,13 +306,13 @@ var patch = (parent, node, oldVNode, newVNode, listener, isSvg) => { while (oldHead <= oldTail) { if (getKey((oldVKid = oldVKids[oldHead++])) == null) { - node.removeChild(oldVKid.node) + oldVKid.node.remove() } } for (var i in keyed) { if (newKeyed[i] == null) { - node.removeChild(keyed[i].node) + keyed[i].node.remove() } } }