react-native-swiper icon indicating copy to clipboard operation
react-native-swiper copied to clipboard

Is there a prop where I can get the swipe progress?

Open Kleinhummel opened this issue 6 years ago • 1 comments

Which OS ?

Android 9

Version

Which versions are you using:

  • react-native-swiper v1.6.0?
  • react-native v0.61.4

Expected behaviour

There should be a prop like onSwipe that gets the progress of the swipe action. I think of it like the onScroll prop of the ScrollView but with different event information.

Actual behaviour

There is no such onSwipe prop and no way to track the swipe progress (For example if I want to move another element simultaneously to the swipe progress). At the moment it is only possible to subscribe to the start/end of a swipe, but not to all steps in between.

Kleinhummel avatar May 25 '20 09:05 Kleinhummel

It's not in the documentation, but you can simply attach an onScroll prop.

<Swiper onScroll={e => { console.log(e) }}>

You can then get the event data through e.nativeEvent

0kzh avatar Jun 08 '20 18:06 0kzh