File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 18
18
- Disable hook when necessary
19
19
- Filter undesired events (like mouse right clicks)
20
20
21
+ # Installation
22
+ ``` shell
23
+ yarn add use-long-press
24
+ ```
25
+ or
26
+ ``` shell
27
+ npm install --save use-long-press
28
+ ```
29
+
30
+ # Basic usage
31
+ Basic hook usage example to get started immediately
32
+ ``` tsx
33
+ import React from ' react' ; // No longer necessary in newer React versions
34
+ import { useLongPress } from ' use-long-press' ;
35
+
36
+ const Example = () => {
37
+ const handlers = useLongPress (() => {
38
+ // Your long press handler
39
+ alert (' Long pressed!' );
40
+ });
41
+ return <button { ... handlers ()} >Press me</button >;
42
+ };
43
+ ```
44
+
21
45
# Documentation
22
46
23
- Full documentation can be found [ here] ( https://minwork.gitbook.io/long-press-hook/ )
47
+ Full documentation can be found [ here] ( https://minwork.gitbook.io/long-press-hook/ ) .
24
48
25
49
# Support
26
50
You can’t perform that action at this time.
0 commit comments