File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export default class StyleSheet {
18
18
this . options = options || { } ;
19
19
}
20
20
21
- createStaticSheetAndAttach ( name ) {
21
+ createStaticSheet ( name ) {
22
+ if ( this . staticSheet ) {
23
+ return ;
24
+ }
25
+
22
26
const options = copy ( this . options ) ;
23
27
24
28
if ( ! options . meta ) {
@@ -29,11 +33,11 @@ export default class StyleSheet {
29
33
this . styles ,
30
34
options
31
35
) ;
36
+ }
32
37
33
- if ( ! isEmpty ( this . staticSheet . classes ) ) {
34
- this . staticSheet . attach ( ) ;
35
- this . refs ++ ;
36
- }
38
+ attachStaticSheet ( ) {
39
+ this . staticSheet . attach ( ) ;
40
+ this . refs ++ ;
37
41
}
38
42
39
43
createDynamicSheetAndAttach ( id , name ) {
@@ -84,8 +88,10 @@ export default class StyleSheet {
84
88
}
85
89
86
90
attach ( id , name ) {
87
- if ( ! this . staticSheet ) {
88
- this . createStaticSheetAndAttach ( name ) ;
91
+ this . createStaticSheet ( name ) ;
92
+
93
+ if ( ! isEmpty ( this . staticSheet . classes ) ) {
94
+ this . attachStaticSheet ( ) ;
89
95
}
90
96
91
97
this . createDynamicSheetAndAttach ( id , name ) ;
You can’t perform that action at this time.
0 commit comments