INNER CODE UNIT · JavaScript

nextSlide

imranhsayed/woo-next · src/components/home/hero-carousel/index.js:22

    const nextSlide = () => {

        if ( 1 === heroCarousel.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 === heroCarousel.length - 1 ) {

            activeIndexRef.current.activeIndex = 0;
            setRestartSlide( restartSlide + 1 );

        } else {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…