TouchableWithoutFeedback
TouchableWithoutFeedback
Do not use unless you have a very good reason. All elements that respond to press should have a visual feedback when touched.
TouchableWithoutFeedback supports only one child. If you wish to have several child components, wrap them in a View.
Props
accessibilityComponentType?: PropTypes.oneOf( AccessibilityComponentTypes )
accessibilityTraits?: PropTypes.oneOfType([ PropTypes.oneOf(AccessibilityTraits), PropTypes.arrayOf(PropTypes.oneOf(AccessibilityTraits)), ])
accessible?: PropTypes.bool
delayLongPress?: PropTypes.number
Delay in ms, from onPressIn, before onLongPress is called.
delayPressIn?: PropTypes.number
Delay in ms, from the start of the touch, before onPressIn is called.
delayPressOut?: PropTypes.number
Delay in ms, from the release of the touch, before onPressOut is called.
disabled?: PropTypes.bool
If true, disable all interactions for this component.
hitSlop?: {top: number, left: number, bottom: number, right: number}
This defines how far your touch can start away from the button. This is added to pressRetentionOffset
when moving off of the button. NOTE The touch area never extends past the parent view bounds and the Z-index of sibling views always takes precedence if a touch hits two overlapping views.
onLayout?: PropTypes.func
Invoked on mount and layout changes with
{nativeEvent: {layout: {x, y, width, height}}}
onLongPress?: PropTypes.func
onPress?: PropTypes.func
Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock).
onPressIn?: PropTypes.func
onPressOut?: PropTypes.func
pressRetentionOffset?: {top: number, left: number, bottom: number, right: number}
When the scroll view is disabled, this defines how far your touch may move off of the button, before deactivating the button. Once deactivated, try moving it back and you'll see that the button is once again reactivated! Move it back and forth several times while the scroll view is disabled. Ensure you pass in a constant to reduce memory allocations.
© 2015–2017 Facebook Inc.
Licensed under the Creative Commons Attribution 4.0 International Public License.
https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html