Reputation: 4486
I have something like this:
<TouchableNativeFeedback
onPress={this._changeAccount.bind(this, user)}
delayPressIn={0}
delayPressOut={0}
useForeground={true}
background={RippleColor('#ccc')}
>
<PhotoStatus>
</TouchableNativeFeedback>
When I click on the "PhotoStatus" component, nothing happens.
The onPress function is not called.
It would be such a thing: PhotoStatus
<View>
<Image
source={image}
style={{
width: dim - 30,
height: dim - 30,
borderRadius: (dim - 30) / 2,
}}
/>
</View>
if instead I replace directly with the component code contained in it, it works.
In the example on expo the used where in the image below there are the two red squares marked.
Link Expo: expo
Upvotes: 0
Views: 680
Reputation: 2833
Wrap your component in View and it should fix the error
<TouchableNativeFeedback
onPress={this._changeAccount.bind(this, user)}
delayPressIn={0}
delayPressOut={0}
useForeground={true}
background={RippleColor('#ccc')}
>
<View>
<PhotoStatus>
</View>
</TouchableNativeFeedback>
Upvotes: 1