Environment
Environment:
OS: macOS High Sierra 10.13.2
Node: 8.9.4
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0
Steps to Reproduce
This is a follow up to #10180 which was prematurely closed.
The TouchableWithoutFeedback component will not fire its onLayout or onPress functions unless the immediate child of the component is a View. Using any other custom component as the child, even if said component is itself implemented with a View at the top level, will prevent TouchableWithoutFeedback from functioning properly.
This won't work:
const MyCustomComponent = () => {
<View>
<Text>Hello world</Text>
</View>
}
<TouchableWithoutFeedback onLayout={...} onPress={...}>
<MyCustomComponent />
</TouchableWithoutFeedback>
but this will work:
<TouchableWithoutFeedback onLayout={...} onPress={...}>
<View>
<Text>Hello world</Text>
</View>
</TouchableWithoutFeedback>
Expected behaviour is that both those above examples should work - that is, the onLayout and onPress callbacks should get invoked at their appropriate times.
Environment
Environment:
OS: macOS High Sierra 10.13.2
Node: 8.9.4
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0
Steps to Reproduce
This is a follow up to #10180 which was prematurely closed.
The
TouchableWithoutFeedbackcomponent will not fire itsonLayoutoronPressfunctions unless the immediate child of the component is aView. Using any other custom component as the child, even if said component is itself implemented with aViewat the top level, will preventTouchableWithoutFeedbackfrom functioning properly.This won't work:
but this will work:
Expected behaviour is that both those above examples should work - that is, the
onLayoutandonPresscallbacks should get invoked at their appropriate times.