Enhance the functionality of the standard TouchableOpacity component in React Native by seamlessly integrating the
capability for double presses. This package provides a DoubleTouchableOpacity
component, allowing developers to easily
incorporate double-click interactions into their React Native applications.
npm install react-native-double-press
import DoubleTouchableOpacity from 'react-native-double-press';
<DoubleTouchableOpacity onPress={onItemPressHandler} onDoublePress={onToggleBookmarkPressHandler}>
<Text>Press me once or double.</Text>
</DoubleTouchableOpacity>
All props are spread onto underlying TouchableOpacity component
Name | Type | Description |
---|---|---|
onDoublePress | ((event: GestureResponderEvent) => void) | undefined | Called when double press was detected. |
doublePressDelay | number | undefined | Defaults to 250ms |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library