This repository was archived by the owner on Jan 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 3030 ],
3131 "license" : " MIT" ,
3232 "dependencies" : {
33- "isomorphic-style-loader" : " ^2.0.0" ,
3433 "react-modal" : " ^1.4.0"
3534 },
3635 "peerDependencies" : {
6665 "react-hot-loader" : " ^1.3.0" ,
6766 "rimraf" : " ^2.5.3" ,
6867 "sass-loader" : " ^4.0.0" ,
69- "style-loader" : " ^0.13.1 " ,
68+ "isomorphic- style-loader" : " ^2.0.0 " ,
7069 "webpack" : " ^1.13.1" ,
7170 "webpack-dev-server" : " ^1.14.1"
7271 },
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ class ReactImageLightbox extends Component {
167167
168168 componentDidMount ( ) {
169169 this . mounted = true ;
170+ ReactImageLightbox . loadStyles ( ) ;
170171 this . attachListeners ( ) ;
171172
172173 this . loadAllImages ( ) ;
@@ -1218,6 +1219,13 @@ class ReactImageLightbox extends Component {
12181219 } ;
12191220 }
12201221
1222+ static loadStyles ( ) {
1223+ // Insert component styles
1224+ if ( typeof window === 'object' ) {
1225+ styles . _insertCss ( ) ;
1226+ }
1227+ }
1228+
12211229 render ( ) {
12221230 const {
12231231 animationDisabled,
@@ -1416,12 +1424,6 @@ class ReactImageLightbox extends Component {
14161424 } ,
14171425 } ;
14181426
1419- // Insert component styles
1420- if ( typeof window === 'object' ) {
1421- styles . _insertCss ( ) ;
1422- }
1423-
1424-
14251427 // DEPRECATION NOTICE
14261428 // All unprefixed classes (listed below) will be removed in v4.0.0.
14271429 // Use their `ril-` prefixed alternatives instead.
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ module.exports = {
4040 {
4141 test : / \. s c s s $ / ,
4242 loaders : [
43- 'style-loader' ,
43+ 'isomorphic- style-loader' ,
4444 'css-loader?modules&-autoprefixer&importLoaders=1&localIdentName=[local]___[hash:base64:5]' ,
4545 'postcss-loader' ,
4646 'sass-loader' ,
You can’t perform that action at this time.
0 commit comments