From 6cb208752b112caa11a6fb41ef0a2dd624bd4630 Mon Sep 17 00:00:00 2001
From: "quisi.do" <github@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 fe95024a..a60e5b0e 100644
--- a/src/pure.js
+++ b/src/pure.js
@@ -281,7 +281,7 @@ function cleanup() {
     act(() => {
       root.unmount()
     })
-    if (container.parentNode === document.body) {
+    if (document.body !== null && container.parentNode === document.body) {
       document.body.removeChild(container)
     }
   })