react-native-swipe-list-view
react-native-swipe-list-view copied to clipboard
onSwipeValueChange - throttle?
I noticed that onSwipeValueChange fires A LOT when a callback is provided.
Is it possible to throttle it?
On a simple swipe from one end of the screen to the other (on iPhone 11), the callback is fired 112 times.
@simplenotezy There is a listener on the animated value that is used to swipe the row which is added via this method https://reactnative.dev/docs/animatedvalue#addlistener
There is no built in way to throttle the listener. I could add throttling to how often the onSwipeValueChange prop function is called, but it seems like unnecessary work as I've never seen performance degradation, have you?
hey i noticed performance degradation in this case. I create swipe to delete and standalone swipe from right and standalone swipe from left and it's working so slow. @simplenotezy is right it's too much re-renders when onSwipeValueChange is trigger. @jemise111