React-native: TouchableWithoutFeedback doesn't support styling

Created on 7 Mar 2018  Â·  7Comments  Â·  Source: facebook/react-native

TouchableWithoutFeedback doesn't support styling on itself, which is odd as all other touchables do support styling. This leads to unexpected behaviour.

Expected Behavior

TouchableWithoutFeedback to take styles.

Actual Behavior

TouchableWithoutFeedback does not take in any styles.

Steps to Reproduce

Snack: https://snack.expo.io/BJHqfjpOf
Here you can see that the TouchableWithoutFeedback component doesn't get styled properly. It works when the styling is applied to the child View, but this isn't always desirable.

The TouchableOpacity on the other hand styles fine.

One reason to use TouchableWithoutFeedback for example would be a background overlay where you want to hide the overlay on pressing the background.

Currently you have to use TouchableOpacity with activeOpacity={1} to mimic the desired behaviour.

Ran Commands Locked

Most helpful comment

@react-native-bot this issue contained enough information and a Snack.

Would be great if a team member could reply to this and open it up again, it's a real bug.

All 7 comments

Thanks for posting this! It looks like your issue may be incomplete. Are all the fields required by the Issue Template filled out?

You may safely ignore this if you believe your issue contains all the relevant information. Thank you for your contributions.

How to Contribute • What to Expect from Maintainers

This issue was marked as lacking information required by the issue template. There has been no activity on this issue for a while, so I will go ahead and close it.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

If you are the author of this issue and you believe this issue was closed in error (i.e. you have edited your issue to ensure it meets the template requirements), please let us know.

@react-native-bot this issue contained enough information and a Snack.

Would be great if a team member could reply to this and open it up again, it's a real bug.

Faced same issue today, TouchableWithoutFeedback is the most important one of the Touchable components, i use it in the flatlist items.

It would be great to implement style prop for TouchableWithoutFeedback like the others (TouchableHighlight and TouchableOpacity).

Any thoughts on wrapping TouchableWithoutFeedback in a styled view vs wrapping a styled view in a TouchableWithoutFeedback?

@ysthedood Hey, you can make a View with your style under TouchableWithoutFeedback.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlongster picture jlongster  Â·  3Comments

lazywei picture lazywei  Â·  3Comments

WG-Com picture WG-Com  Â·  3Comments

anchetaWern picture anchetaWern  Â·  3Comments

axelg12 picture axelg12  Â·  3Comments