INNER CODE UNIT · JavaScript
nextSlide
imranhsayed/woo-next · src/components/single-product/gallery-carousel/index.js:19
const nextSlide = () => {
if ( 1 === gallery.length ) {
return null;
}
/**
* If if autoplay is set to true
* and all slides are finished playing,
* set the activeIndex to one and restart the slide from start.
*/
if ( activeIndexRef.current.activeIndex === gallery.length - 1 ) {
activeIndexRef.current.activeIndex = 0;
setRestartSlide( restartSlide + 1 );
} else {