-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
I'm finding more often than not that I do this:
<Row>
<Touchable onPress={}>...</Touchable>
<Row>
Why not just toggle the Component type to Touchable (handling Platform differences as well) when onPress is present?
<Row onPress={}>...</Row>
and like so
const Component = !onPress
? View
: Platform.OS === 'android'
? TouchableNativeFeedback
: TouchableHighlight
<Component style={[_style, _shorthandStyles, style]} onPress={onPress || () => null} {...otherProps} >
{props.children}
</Component>
pass the empty function to View ? There might be a better way.