react-snap-carousel icon indicating copy to clipboard operation
react-snap-carousel copied to clipboard

Infinite scroll

Open WillSmithTE opened this issue 10 months ago • 2 comments

Thanks a lot for the library, it's really great.

Is there any chance you have an example of someone using it to implement an infinite scroll? Right now I'm navigating back to the start, which works, but makes it obvious to the user that they're back at the start.

    const onNext = () => {
        if (activePageIndex === pages.length - 1) {
            goTo(0)
        } else {
            next()
        }
    }
    const onPrev = () => {
        if (activePageIndex === 0) {
            goTo(pages.length - 1)
        } else {
            prev()
        }
    }

Netflix is an example of an infinite carousel which doesn't look like you're going back to the start. Thanks!

WillSmithTE avatar Aug 17 '23 16:08 WillSmithTE