How to stop touch event propagation in React-Native

This might be new since the previous answers, but I find you can just gobble the event using another “touchable”:

<TouchableOpacity onPress={this.onPressOuter}>
    <TouchableOpacity activeOpacity={1}>
        <Text>Content</Text>
    </TouchableOpacity>
</TouchableOpacity>

In this example, touching the text does not trigger onPressOuter

Leave a Comment