@os-design/use-click-outside 1.0.33 → 1.0.35
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 +5 -5
- package/src/index.mdx +1 -1
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import useEvent from '@os-design/use-event';
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
const useClickOutside = (target, listener) => {
|
|
4
|
-
const listenerRef = useRef();
|
|
4
|
+
const listenerRef = useRef(undefined);
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
listenerRef.current = listener;
|
|
7
7
|
}, [listener]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/use-click-outside",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design.git",
|
|
6
6
|
"type": "module",
|
|
@@ -23,16 +23,16 @@
|
|
|
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-event": "^1.0.
|
|
32
|
+
"@os-design/use-event": "^1.0.33"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "
|
|
35
|
+
"react": "19"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "f333f60e39273574d2227cf0ee70b0c8897b2dde"
|
|
38
38
|
}
|
package/src/index.mdx
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ const useClickOutside = (
|
|
|
5
5
|
target: Element | RefObject<Element>,
|
|
6
6
|
listener: EventListener
|
|
7
7
|
): void => {
|
|
8
|
-
const listenerRef = useRef<EventListener>();
|
|
8
|
+
const listenerRef = useRef<EventListener>(undefined);
|
|
9
9
|
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
listenerRef.current = listener;
|