Skip to content

Commit

Permalink
cssom: the ownerNode might have already been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
sastan committed Jan 27, 2022
1 parent f1fe9a8 commit 49002ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/stupid-pigs-live.md
@@ -0,0 +1,5 @@
---
'twind': patch
---

cssom: the ownerNode might have already been removed
3 changes: 1 addition & 2 deletions packages/twind/src/sheets.ts
Expand Up @@ -31,8 +31,7 @@ export function cssom(target = createStyleElement().sheet as CSSStyleSheet): She
},

destroy() {
// eslint-disable-next-line @typescript-eslint/no-extra-semi
;(target.ownerNode as Element).remove()
target.ownerNode?.remove()
},

insert(css, index) {
Expand Down

0 comments on commit 49002ca

Please sign in to comment.