question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TouchableWithoutFeedback doesn't support styling

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:7

github_iconTop GitHub Comments

15reactions
react-native-botcommented, Mar 15, 2018

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.

8reactions
TheDutchCodercommented, Mar 15, 2018

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native TouchableWithoutFeedback is not working
Try using it like this: const DismissKeyboard = ({children}) => ( <TouchableWithoutFeedback accessible={false} onPress={() ...
Read more >
TouchableWithoutFeedback - React Native
TouchableWithoutFeedback supports only one child. If you wish to have several child components, wrap them in a View.
Read more >
Wrapping with TouchableWithoutFeedback - React Native
<View style={styles.container}> <TouchableWithoutFeedback onPress={onPress}> ... the rest of the button does not react to clicks.
Read more >
TouchableWithoutFeedback – React Native - Deco IDE
TouchableWithoutFeedback. Do not use unless you have a very good reason. All the elements that respond to press should have a visual feedback...
Read more >
TouchableWithoutFeedback · React Native
This is one of the primary reasons a "web" app doesn't feel "native". NOTE: TouchableWithoutFeedback supports only one child.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found