I was making a program in React native in which there are two buttons which when pressed will increase a tap counter. The problem is when one button is pressed the other won't respond and doesn't increase the counter. The button is made with Touchableopacity and the action is done by onPress.
<View style = {{flex:1,flexDirection:'row',justifyContent:'center'}}>
<View>
<TouchableOpacity style = {styles.button}
onPress = {() => this.start() }
>
<Text style={styles.buttonText}>
Tap
</Text>
</TouchableOpacity>
</View>
<View>
<TouchableOpacity style = {styles.button}
onPress = {() => this.start() }>
<Text style={styles.buttonText}>
Tap
</Text>
</TouchableOpacity>
</View>
</View>
</View>