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 2525 "test:watch" : " react-scripts test --env=jsdom" ,
2626 "prebuild" : " yarn run lint:fix" ,
2727 "build" : " rollup -c" ,
28- "prepare" : " yarn run build" ,
2928 "build-doc" : " docz build" ,
3029 "deploy-doc" : " gh-pages -d demo"
3130 },
Original file line number Diff line number Diff line change @@ -206,7 +206,11 @@ class Carousel extends React.Component {
206206 // go back from 0ms to whatever set by the user
207207 // We were at 0ms because we wanted to disable animation on resize
208208 // see https://github.com/sag1v/react-elastic-carousel/issues/94
209- window . requestAnimationFrame ( ( ) => this . setState ( { transitionMs } ) ) ;
209+ window . requestAnimationFrame ( ( ) => {
210+ if ( this . isComponentMounted ) {
211+ this . setState ( { transitionMs } ) ;
212+ }
213+ } ) ;
210214 return {
211215 sliderPosition,
212216 activeIndex : newActiveIndex < 0 ? 0 : newActiveIndex
You can’t perform that action at this time.
0 commit comments