Open chrisbobbe opened 3 years ago
Without being able to give the icon component a
hitSlop
prop of 24dp (or any value), I have to wrap the component with, e.g., aPressable
or aTouchableHighlight
component that I can passhitSlop
to, along withonPress
And perhaps I should just do this. I could make a convenience component of my own, that does this.
E.g., if I'm using Material Design, icons should be 24dp square, while touch targets should be at least 48dp square.
Icon components already take an
onPress
prop.Without being able to give the icon component a
hitSlop
prop of 12dp on all sides (or any value), I have to wrap the component with, e.g., aPressable
or aTouchableHighlight
component that I can passhitSlop
to, along withonPress
. It's mildly cumbersome, and I'm not usingIcon.Button
because its interface ("A convenience component for creating buttons with [text, and] an icon on the left side") isn't really what I'm looking for (it comes with some default color and layout styles that go beyond the idea of just a "pressable icon").Since icon components are implemented with
Text
, andText
components don't take ahitSlop
prop, possibly the answer is that...React Native should either removeText
'sonPress
prop, or letText
takehitSlop
. 🙂But I wanted to post this here in case the maintainers wanted to give their thoughts on the question.