I am trying to use lodash.throttling to limit the number of onPress calls in a Touchable Highlight, using the below codes, but none works :
<TouchableHighlight
onPress={throttle(this.onPressHandler,5000,{leading:true, trailing:false})}>
<TouchableHighlight
onPress={()=>throttle(this.onPressHandler,5000,{leading:true, trailing:false})}>
However, when I put a console.log in the "onPressHandler" function, I see that the function is being called multiple times even if I tap the TouchableHighlight in quick succession.
What am I missing?