From 5fd2d547a98c968e81e274d3e56e7fc28a4f7f3d Mon Sep 17 00:00:00 2001 From: "quisi.do" Date: Mon, 20 May 2024 13:01:20 -0700 Subject: [PATCH] support `document` containers in cleanup --- src/pure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pure.js b/src/pure.js index f546af98..01b80ee7 100644 --- a/src/pure.js +++ b/src/pure.js @@ -263,7 +263,7 @@ function cleanup() { act(() => { root.unmount() }) - if (container.parentNode === document.body) { + if (document.body !== null && container.parentNode === document.body) { document.body.removeChild(container) } })