From 31ebb1d99fba4f7c9ea633238cac8c7483fa54b4 Mon Sep 17 00:00:00 2001 From: wanger <1206180097@qq.com> Date: Wed, 28 Oct 2020 20:31:35 +0800 Subject: [PATCH] Fix "DELETION" exception `didact` will repeatedly delete child elements, and will throw a exception: ``` index.js:120 Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. at commitWork (http://localhost:1234/test01.e31bb0bc.js:222:15) at Array.forEach () at commitRoot (http://localhost:1234/test01.e31bb0bc.js:204:13) at workLoop (http://localhost:1234/test01.e31bb0bc.js:255:5) ``` See details in [issue 30](https://github.com/pomber/didact/issues/30) --- didact.js | 1 + 1 file changed, 1 insertion(+) diff --git a/didact.js b/didact.js index 62436f1..4c3ad2f 100644 --- a/didact.js +++ b/didact.js @@ -123,6 +123,7 @@ function commitWork(fiber) { ) } else if (fiber.effectTag === "DELETION") { commitDeletion(fiber, domParent) + return } commitWork(fiber.child)