TouchableNativeFeedback inconsistency with React Native's
See original GitHub issueTouchableNativeFeedback of RNGH is inconsistent with RN’s internal component:
<TouchableNativeFeedback background={TouchableNativeFeedback.Ripple('white', false)}>
<View style={{ width: 50, height: 50, marginBottom: 100 }} />
</TouchableNativeFeedback>
This code results in nice effect with RN’s internal component, while with RNGH’s component we have ripple effect not just on View’s area, but also on all marginBottom’s area, which looks ugly…
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top Results From Across the Web
TouchableNativeFeedback inconsistency with React Native's · Issue ...
Hi! TouchableNativeFeedback is a tricky one . On iOS it uses React Native's implementation, but on Android it relies on BaseButton component, same...
Read more >React Native TouchableNativeFeedback.Ripple(color
TouchableNativeFeedback hasn't always being defective for me. This particular snippet of code : render() { const btnStyle = this.props.
Read more >TouchableNativeFeedback - React Native
A wrapper for making views respond properly to touches (Android only). On Android this component uses native state drawable to display touch ...
Read more >Touchables | React Native Gesture Handler - Software Mansion
Gesture Handler library provides an implementation of RN's touchable components that are based on native buttons and does not rely on JS responder...
Read more >react-native-action-button-resize - npm
customizable multi-action-button component for react-native. ... Android: Activate this to fix TouchableNativeFeedback Ripple UI problems.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi!
TouchableNativeFeedbackis a tricky one 😞. On iOS it uses React Native’s implementation, but on Android it relies onBaseButtoncomponent, same as the rest of GH’s touchables. In order for ripple not to cover the margin area you would have to set the margin usingcontainerStyleprop (it’s not in the type declarations, so you will get errors but it will work), however since only Android relies on GH’s implementation, this prop will have no effect on iOS. I know it’s not a solution, but with that you should be able to make some sort of a workaround.@piaskowyk Just checked. The issue is still relevant with version
2.1.0.Seems, that RNGH’s component does not take into consideration 2nd parameter of
TouchableNativeFeedback.Ripple-borderless. It always acts like it’strue, even iffalseis passed.RN’s component handles properly both
borderless = true | false.