<Touchable*> styling is not compatible with React Native Touchables #607
Labels
Area: Touchable
BugBash 31.03
Important
This seem to be a serious issue and we will need to take a deeper look into it some time soon
RNGH Touchables have a different behavior from RN Touchables when styling — making them not drop-in compatible.
Take for example:
this is the behavior of RN TouchableOpacity (and of RNGH
BaseButton
):this is the behavior of RNGH touchables:
the yellow box is a touchable with
flex: 1
.The problem is that all RNGH Touchables render two wrapped views:
https://github.com/kmagiera/react-native-gesture-handler/blob/baf2ba72ea4fca22a11b507cffb4ee94f0126480/touchables/GenericTouchable.js#L258-L266
The styles are applied to the child view, so applying
flex: 1
doesn't do what one would expect.I think the only way to avoid this incompatibility is to render just one native view. This should also be a little more performant.
I'm willing to help with implementation (at least on JS+iOS side), but I would need some basic pointers as to how to make
RawButton
acceptView
props…The text was updated successfully, but these errors were encountered: