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 {
1818 this . options = options || { } ;
1919 }
2020
21- createStaticSheetAndAttach ( name ) {
21+ createStaticSheet ( name ) {
22+ if ( this . staticSheet ) {
23+ return ;
24+ }
25+
2226 const options = copy ( this . options ) ;
2327
2428 if ( ! options . meta ) {
@@ -29,11 +33,11 @@ export default class StyleSheet {
2933 this . styles ,
3034 options
3135 ) ;
36+ }
3237
33- if ( ! isEmpty ( this . staticSheet . classes ) ) {
34- this . staticSheet . attach ( ) ;
35- this . refs ++ ;
36- }
38+ attachStaticSheet ( ) {
39+ this . staticSheet . attach ( ) ;
40+ this . refs ++ ;
3741 }
3842
3943 createDynamicSheetAndAttach ( id , name ) {
@@ -84,8 +88,10 @@ export default class StyleSheet {
8488 }
8589
8690 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 ( ) ;
8995 }
9096
9197 this . createDynamicSheetAndAttach ( id , name ) ;
You can’t perform that action at this time.
0 commit comments