mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 21:05:29 +08:00
29 lines
742 B
TypeScript
29 lines
742 B
TypeScript
import React from 'react';
|
|
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
|
|
export default function TouchableWithoutFeedbackWrapper({
|
|
onPress,
|
|
onLongPress,
|
|
testID,
|
|
accessibilityLabel,
|
|
accessibilityRole,
|
|
accessibilityStates,
|
|
...rest
|
|
}: React.ComponentProps<typeof TouchableWithoutFeedback> & {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<TouchableWithoutFeedback
|
|
onPress={onPress}
|
|
onLongPress={onLongPress}
|
|
testID={testID}
|
|
hitSlop={{ left: 15, right: 15, top: 0, bottom: 5 }}
|
|
accessibilityLabel={accessibilityLabel}
|
|
accessibilityRole={accessibilityRole}
|
|
accessibilityStates={accessibilityStates}
|
|
>
|
|
<View {...rest} />
|
|
</TouchableWithoutFeedback>
|
|
);
|
|
}
|