Skip to content

Commit 6ed1c1b

Browse files
committed
🐛 Make sure, that singleton is attached
`removeChild` fails loudly if it tries to detach something, which does not have parent, so we always need to check this beforehand. All of the other calls to removeChild() have similar checks already Close #38
1 parent 29eb894 commit 6ed1c1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function initClientProvider() {
124124
if (element.parentNode != document.head) {
125125
document.head.appendChild(element);
126126
}
127-
if (lastVisited && lastVisited.ref) {
127+
if (lastVisited && lastVisited.ref && lastVisited.ref.parentNode) {
128128
document.head!.removeChild(lastVisited.ref);
129129
}
130130

0 commit comments

Comments
 (0)