# reliable-touch-element

> Element with a reliable onTouch

Latest version **1.0.1** (published 2020-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install reliable-touch-element
pnpm add reliable-touch-element
yarn add reliable-touch-element
bun add reliable-touch-element
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-03-23 |
| First published | 2020-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Julien Sergent |
| Maintainers | maddeveloper |
| Keywords | react, touch, reliable, scroll, element, javascript, react-component, hoc |

## Links

- npm: https://www.npmjs.com/package/reliable-touch-element
- Repository: https://github.com/MadDeveloper/reliable-touch-element
- Homepage: https://github.com/MadDeveloper/reliable-touch-element#readme
- Issues: https://github.com/MadDeveloper/reliable-touch-element/issues
- npm.io page: https://npm.io/package/reliable-touch-element

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-03-23
- 1.0.0 — 2020-03-23

## README

# reliable-touch-element

An element providing a reliable `onTouch` callback.
The touch is reliable because the component need to have a `touchstart` and a `touchend` event, without any `touchmove` events, in order to trigger the `onTouch` callback.

For example, can be convenient when you have a scrollable list with touchable elements inside, in order to show/display, or navigate to, the element touched.

## Usage

```jsx
import { ReliableTouchElement } from "reliable-touch-element"
// or
import ReliableTouchElement from "reliable-touch-element"
// but prefer the first 😉

<ReliableTouchElement onTouch={handleTouch}>
  Hello World!
</ReliableTouchElement>
```

## Props

| Prop          | Type     | Required | Description                                         |
| ------------- | -------- | -------- | --------------------------------------------------- |
| onTouch       | function | yes      | Callback triggered when a real touch is detected    |
| children      | any      | no       | Children of the element (wrapped in a div).         |
| any div props |          |          | The component accepts any prop a `div` element can. |

---
_Source: https://npm.io/package/reliable-touch-element · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
