Skip to content

Commit 511d068

Browse files
committed
fix the error by unmounting the style tag
1 parent fb9a377 commit 511d068

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@atomico/hooks",
33
"description": "Series of utilities in hooks format to extend the operation of Atomico",
4-
"version": "3.33.5",
4+
"version": "3.33.6",
55
"type": "module",
66
"workspaces": [
77
"src/**/*"

src/use-css-light-dom/use-css-light-dom.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ export function useCssLightDom(sheet) {
2626
getRules(
2727
sheet,
2828
current.localName + `[data-sheet="${current.dataset.sheet}"]`
29-
).forEach((rule) =>
30-
style.sheet.insertRule(rule, style.sheet.cssRules.length)
29+
).forEach(
30+
(rule) =>
31+
style.sheet &&
32+
style.sheet.insertRule(rule, style.sheet.cssRules.length)
3133
)
3234
);
3335

0 commit comments

Comments
 (0)