diff --git a/src/utils.ts b/src/utils.ts index 982d3512..cc0b0480 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -82,14 +82,41 @@ function extractProps(view: Component, propTypes: object) { return pickBy(filter, view.props); } +const TouchableWithoutFeedbackPropTypes = [ + "accessible", + "accessibilityLabel", + "accessibilityHint", + "accessibilityIgnoresInvertColors", + "accessibilityRole", + "accessibilityState", + "accessibilityActions", + "onAccessibilityAction", + "accessibilityValue", + "accessibilityLiveRegion", + "importantForAccessibility", + "accessibilityViewIsModal", + "accessibilityElementsHidden", + "onFocus", + "onBlur", + "disabled", + "onPress", + "onPressIn", + "onPressOut", + "onLayout", + "touchSoundDisabled", + "onLongPress", + "nativeID", + "testID", + "delayPressIn", + "delayPressOut", + "delayLongPress", + "pressRetentionOffset", + "hitSlop" +]; // Extract Touchable props from the given component instance. // - {`object`} `view` the component instance function extractTouchableProps(view: Component) { - return extractProps(view, { - // @ts-ignore: View.propTypes - ...TouchableWithoutFeedback.propTypes, - testID: PropTypes.string, - }); + return extractProps(view, [...TouchableWithoutFeedbackPropTypes, "testID"]); } // @ts-ignore: View.propTypes