How to trigger another Touchable component's press event by tap a touchable component? thanks!
Example:-
<TouchableHighlight onPress={this._triggerSecond}>
<Image
style={styles.button}
source={require('./myButton.png')}
/>
</TouchableHighlight>
If user will tap on first TouchableHighlight then it should trigger second TouchableHighlight.
<TouchableHighlight>
<Image
style={styles.button}
source={require('./myButton.png')}
/>
</TouchableHighlight>
For those who still need to fire a press programmatically, I found a solution. First you need to bind your touchable to
this
by using ref :then when you want to launch onPress without clicking it just call
Well I guess instead of thinking in that way I guess you can thinking this as just another
TouchableHighlight
calling the same method such as:In this way both components when tap are going to invoke to the same
method
.