File tree Expand file tree Collapse file tree
src/react-elastic-carousel/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " react-elastic-carousel" ,
3- "version" : " 0.11.5-beta.1 " ,
3+ "version" : " 0.11.5-beta.2 " ,
44 "description" : " A flexible and responsive carousel component for react" ,
55 "author" : " sag1v (Sagiv Ben Giat)" ,
66 "license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -215,6 +215,10 @@ class Carousel extends React.Component {
215215 } ;
216216
217217 onSliderResize = sliderNode => {
218+ if ( ! this . isComponentMounted ) {
219+ return ;
220+ }
221+
218222 const {
219223 verticalMode,
220224 children,
@@ -277,7 +281,10 @@ class Carousel extends React.Component {
277281 const containerWidth =
278282 newSliderContainerWidth - ( initialVerticalMode ? 0 : outerSpacing * 2 ) ;
279283
280- if ( this . state . sliderContainerWidth === newSliderContainerWidth ) {
284+ if (
285+ ! this . isComponentMounted ||
286+ this . state . sliderContainerWidth === newSliderContainerWidth
287+ ) {
281288 // prevent infinite loop
282289 return ;
283290 }
You can’t perform that action at this time.
0 commit comments