@bbodek/hooks 0.0.6 → 0.0.7
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/dotoli-hooks.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import { useLayoutEffect as d, useEffect as p, useState as u } from "react";
|
|
2
|
+
const y = typeof window < "u" ? d : p, g = ({
|
|
3
3
|
initialValues: c,
|
|
4
4
|
validate: e
|
|
5
5
|
}) => {
|
|
6
|
-
const [s, f] =
|
|
6
|
+
const [s, f] = u(c), [a, r] = u({});
|
|
7
7
|
return {
|
|
8
8
|
values: s,
|
|
9
9
|
setValues: (o) => {
|
|
@@ -13,21 +13,21 @@ const m = typeof window < "u" ? u.useLayoutEffect : u.useEffect, y = ({
|
|
|
13
13
|
r(n);
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
errors:
|
|
16
|
+
errors: a,
|
|
17
17
|
handleChange: (o) => {
|
|
18
18
|
const { name: t, value: n } = o.target;
|
|
19
19
|
if (t in c && (f({ ...s, [t]: n }), e)) {
|
|
20
|
-
const
|
|
20
|
+
const i = e({
|
|
21
21
|
...s,
|
|
22
22
|
[t]: n
|
|
23
23
|
});
|
|
24
|
-
r(
|
|
24
|
+
r(i);
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
setErrors: r
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
g as useForm,
|
|
32
|
+
y as useIsomorphicLayoutEffect
|
|
33
33
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const useIsomorphicLayoutEffect: typeof
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
3
3
|
export default useIsomorphicLayoutEffect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbodek/hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css,html}\""
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@types/react": "
|
|
28
|
-
"@types/react-dom": "
|
|
29
|
-
"react": "
|
|
30
|
-
"react-dom": "
|
|
27
|
+
"@types/react": "18.2.0",
|
|
28
|
+
"@types/react-dom": "18.2.0",
|
|
29
|
+
"react": "18.2.0",
|
|
30
|
+
"react-dom": "18.2.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"react": "
|
|
34
|
-
"react-dom": "
|
|
33
|
+
"react": "18.2.0",
|
|
34
|
+
"react-dom": "18.2.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@dotoli/eslint-config": "workspace:*",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@dotoli/typescript-config": "workspace:*",
|
|
40
40
|
"@eslint/js": "^9.13.0",
|
|
41
41
|
"@types/node": "^22.9.0",
|
|
42
|
-
"@types/react": "
|
|
43
|
-
"@types/react-dom": "
|
|
42
|
+
"@types/react": "18.3.1",
|
|
43
|
+
"@types/react-dom": "18.3.1",
|
|
44
44
|
"@typescript-eslint/parser": "^7.1.0",
|
|
45
45
|
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
46
46
|
"eslint": "^9.13.0",
|
|
@@ -55,5 +55,8 @@
|
|
|
55
55
|
"vite": "^5.4.10",
|
|
56
56
|
"vite-tsconfig-paths": "^5.1.1"
|
|
57
57
|
},
|
|
58
|
+
"overrides": {
|
|
59
|
+
"@types/scheduler": "< 0.23.0"
|
|
60
|
+
},
|
|
58
61
|
"prettier": "@dotoli/prettier-config"
|
|
59
62
|
}
|