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.