# dyna-ui-fast-click

> React fast click wrapper for an element

Latest version **1.0.6** (published 2018-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install dyna-ui-fast-click
pnpm add dyna-ui-fast-click
yarn add dyna-ui-fast-click
bun add dyna-ui-fast-click
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2018-08-17 |
| First published | 2018-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 38.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | dennisat |

## Links

- npm: https://www.npmjs.com/package/dyna-ui-fast-click
- Repository: https://github.com/aneldev/dyna-ui-fast-click
- Homepage: https://github.com/aneldev/dyna-ui-fast-click#readme
- Issues: https://github.com/aneldev/dyna-ui-fast-click/issues
- npm.io page: https://npm.io/package/dyna-ui-fast-click

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.0.0

## Recent versions

- 1.0.6 (latest) — 2018-08-17
- 1.0.5 — 2018-07-22
- 1.0.4 — 2018-07-02
- 1.0.3 — 2018-06-10
- 1.0.2 — 2018-06-09
- 1.0.1 — 2018-06-08
- 0.1.6 — 2018-06-08
- 0.1.5 — 2018-06-08
- 0.1.4 — 2018-06-08
- 0.1.3 — 2018-06-08

## README

# About

Wrapper to get faster the click on mobiles and tablets.

Global utils like **fastclick** are not working always and is not the cleanest solution.

Some controls need the pure events, global solutions produce problems is some cases.

So, the `DynaFastClick` applies the fast click solution only for what is wrapped.

Wrap it, listen the `onClick` event of the `DynaFastClick` _and not of the content_.

On desktop nothing is changing, the click event is the same one.

Written in TS runs everywhere.

# Under the hood

_The magic recipe_

On mobiles, the `onClick` is called on `touchend`swallowing the `click` event. 

# Usage

```
    <DynaFastClick onClick={()=>console.log('clicked')}>
        <button>Post it</button>
    </DynaFastClick>
```

# Demo

`npm start`

# Props

All props are optional except the children.

```
IDynaFastClickProps = {
	className?: string;     // class name in order to style it
	nodeType?: string;      // default is "span" and creates <span/>, set to "div" to get <div/>
	children: any;          // the content
	onClick?: () => void;   // the click event, triggered as fast as possible
}
```

---
_Source: https://npm.io/package/dyna-ui-fast-click · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
