@etsoo/react 1.7.52 → 1.7.53
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/lib/uses/useRefs.d.ts +1 -1
- package/lib/uses/useRefs.js +1 -1
- package/package.json +4 -4
- package/src/uses/useRefs.ts +3 -3
package/lib/uses/useRefs.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import React from 'react';
|
|
|
5
5
|
* @param fields Fields
|
|
6
6
|
* @returns Result
|
|
7
7
|
*/
|
|
8
|
-
export declare function useRefs<F extends ReadonlyArray<string>, T = HTMLInputElement>(fields: F): DataTypes.DI<F, React.MutableRefObject<T |
|
|
8
|
+
export declare function useRefs<F extends ReadonlyArray<string>, T = HTMLInputElement>(fields: F): DataTypes.DI<F, React.MutableRefObject<T | null>>;
|
package/lib/uses/useRefs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.53",
|
|
4
4
|
"description": "TypeScript ReactJs UI Independent Framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@emotion/css": "^11.11.2",
|
|
51
51
|
"@emotion/react": "^11.11.4",
|
|
52
52
|
"@emotion/styled": "^11.11.5",
|
|
53
|
-
"@etsoo/appscript": "^1.4.
|
|
53
|
+
"@etsoo/appscript": "^1.4.96",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.42",
|
|
55
|
-
"@etsoo/shared": "^1.2.
|
|
55
|
+
"@etsoo/shared": "^1.2.41",
|
|
56
56
|
"react": "^18.3.1",
|
|
57
57
|
"react-dom": "^18.3.1",
|
|
58
58
|
"react-router-dom": "^6.23.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/react-window": "^1.8.8",
|
|
73
73
|
"jest": "^29.7.0",
|
|
74
74
|
"jest-environment-jsdom": "^29.7.0",
|
|
75
|
-
"ts-jest": "^29.1.
|
|
75
|
+
"ts-jest": "^29.1.4",
|
|
76
76
|
"typescript": "^5.4.5"
|
|
77
77
|
}
|
|
78
78
|
}
|
package/src/uses/useRefs.ts
CHANGED
|
@@ -8,8 +8,8 @@ import React from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
export function useRefs<F extends ReadonlyArray<string>, T = HTMLInputElement>(
|
|
10
10
|
fields: F
|
|
11
|
-
): DataTypes.DI<F, React.MutableRefObject<T |
|
|
12
|
-
const refs: Record<string, React.MutableRefObject<T |
|
|
13
|
-
fields.forEach((field) => (refs[field] = React.useRef<T>()));
|
|
11
|
+
): DataTypes.DI<F, React.MutableRefObject<T | null>> {
|
|
12
|
+
const refs: Record<string, React.MutableRefObject<T | null>> = {};
|
|
13
|
+
fields.forEach((field) => (refs[field] = React.useRef<T>(null)));
|
|
14
14
|
return refs as any;
|
|
15
15
|
}
|