Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Continuously increasing counter with long press React Native

$
0
0

I have a button next to a TextInput that increases its counter when pressed.

<TouchableWithoutFeedback onPress={() => {this.increaseAmount(step, rowID)}}><View style={styles.amountPlusButtonContainer}><Text style={styles.amountButtonText}>+</Text></View></TouchableWithoutFeedback>

It currently increases by 1 each time I tap the button. What I want to achieve is to keep increasing the counter for as long as the user is pressing it.

I have tried to use setInterval() but I don't know exactly when to stop it nor if it's the right approach to this problem.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>