@os-design/use-long-press 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/src/index.mdx +1 -1
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
const useLongPress = (callback, ms = 500) => {
|
|
4
4
|
const callbackRef = useRef(callback);
|
|
5
5
|
const msRef = useRef(ms);
|
|
6
|
-
const timeout = useRef();
|
|
6
|
+
const timeout = useRef(undefined);
|
|
7
7
|
const [pressed, setPressed] = useState(false);
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
callbackRef.current = callback;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/use-long-press",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design.git",
|
|
6
6
|
"type": "module",
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"scripts": {
|
|
22
|
-
"clean": "
|
|
22
|
+
"clean": "rm -r dist",
|
|
23
23
|
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx --out-dir dist",
|
|
24
24
|
"build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --declarationDir dist",
|
|
25
25
|
"build": "yarn clean && npm-run-all 'build:*'",
|
|
26
|
-
"ncu": "ncu -u
|
|
26
|
+
"ncu": "ncu -u"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@os-design/use-prevent-default-event": "^1.0.
|
|
32
|
+
"@os-design/use-prevent-default-event": "^1.0.31"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "
|
|
35
|
+
"react": "19"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "83ca5af2bb91d07d64440f87b7ab23f5100daa02"
|
|
38
38
|
}
|
package/src/index.mdx
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ const useLongPress = (
|
|
|
19
19
|
): LongPressHandlers => {
|
|
20
20
|
const callbackRef = useRef(callback);
|
|
21
21
|
const msRef = useRef(ms);
|
|
22
|
-
const timeout = useRef<NodeJS.Timeout>();
|
|
22
|
+
const timeout = useRef<NodeJS.Timeout>(undefined);
|
|
23
23
|
const [pressed, setPressed] = useState(false);
|
|
24
24
|
|
|
25
25
|
useEffect(() => {
|