react-view-pager icon indicating copy to clipboard operation
react-view-pager copied to clipboard

Bug with React 16: empty frames in an infinite carousel

Open azangru opened this issue 6 years ago • 0 comments

Hi,

I have updated our app to React 16, and noticed a problem with react-view-pager. When it is used as an infinite carousel, rapid changing of slides will produce empty frames. This is especially apparent when changing to previous slides.

Key points for reproducing the bug:

  • the Track component should receive the infinite prop
  • slides should be changed quickly (before react-motion has stopped calculating the position of the slide)
  • I am getting this bug when calling the prev and next methods on the Track component (switching to previous slides reproduces the bug more reliably).

It seems like there are some problems here: https://github.com/souporserious/react-view-pager/blob/master/src/Pager.js#L100-L101

See a minimal reproduction case in this repo

azangru avatar Mar 08 '18 00:03 azangru