Skip to content

mleister97/react-native-double-press

Repository files navigation

react-native-double-press

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.

Installation

npm install react-native-double-press

Usage

import DoubleTouchableOpacity from 'react-native-double-press';

<DoubleTouchableOpacity onPress={onItemPressHandler} onDoublePress={onToggleBookmarkPressHandler}>
  <Text>Press me once or double.</Text>
</DoubleTouchableOpacity>

API

Props

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

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published