I want to give some style to the TouchableWithNativeFeedback , The style prop doesnot work although it works fine with the TouchableOpacity but it wont work with the native feedback. Is there any way we can make it work. I found a solution but I dont want to do it is there any other way.
The solution that I found in github.
link :
https://github.com/facebook/react-native/issues/8307
Answer:
I was having the same issue. But I wrapped the TouchableWithoutFeedback element with a view and styled the view instead. And I wrapped everything inside the TouchableWithoutFeedback with another view with a style identical to the parent view. This seems to have fixed it for me.
Thank you.
This is not possible, since TouchableWithNativeFeedback does not have a style prop. This is documented here in the documentation.
The recommended pattern is the one you do not want to use (for whatever reason).
// the styling in the view of the child of TouchableWithoutFeedback
<TouchableWithoutFeedback onPress={onPress}>
<View style={styles.button}>
<Text>Touch</Text>
</View>
</TouchableWithoutFeedback>