leandrowd / react-responsive-carousel

React.js Responsive Carousel (with Swipe)
http://leandrowd.github.io/react-responsive-carousel/
MIT License
2.66k stars 629 forks source link

using multiple carousel in a page with scroll bar #244

Closed viveknandhangelella closed 3 years ago

viveknandhangelella commented 6 years ago

I am using multiple carousels in a page that has scroll when I scroll to and fro then images are rerendering can you please Help

leandrowd commented 6 years ago

Could you try to simulate your problem on our codesandbox and share a link here? Use https://codesandbox.io/s/lp602ljjj7 as base.

jaredshaunsmith commented 5 years ago

Having this issue as well - as soon as you scroll up or down on the page the carousel resets to the first slide

brunoluvizotto commented 5 years ago

I have the same issue described by @jaredshaunsmith, which I think it's different than the one on this issue. The carousel goes back to the image as soon as the page scrolls up or down.

jaredshaunsmith commented 5 years ago

@Brudhu We found a fix for our issue related to a greater component re-rendering issue - see this link: https://medium.com/@ryanflorence/react-context-and-re-renders-react-take-the-wheel-cd1d20663647

replacing React.Component with React.PureComponent makes the component only re-render when the props/state change and fixed the carousel sliding back to slide 1 on any scroll activity

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.