Skip to content

Commit 22050b8

Browse files
authored
Merge pull request #109 from mdqst/patch-1
fix: removal of empty style elements in SSR handling
2 parents 5d0f9c8 + 147ab67 commit 22050b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

static/scripts/styled-components-fix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
(function() {
33
const styleElements = document.querySelectorAll('style[data-styled]');
44
styleElements.forEach(style => {
5-
if (style.innerHTML === '') {
5+
if (style.sheet && style.sheet.cssRules.length === 0) {
66
style.parentNode.removeChild(style);
77
}
88
});
9-
})();
9+
})();

0 commit comments

Comments
 (0)