I have a component like this:
<TouchableOpacity onPress={parentOnPress}>
<TouchableOpacity onPress={childOnPress} disabled={isDisabled}>
<View><Text> Just a child </Text></View>
</TouchableOpacity>
</TouchableOpacity>
if isDisabled
is true
, and the child TouchableOpacity is clicked, then it triggers the parentOnPress
method.
How to prevent this from happening?