@bbodek/hooks 0.0.5 → 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.
@@ -1,9 +1,9 @@
1
- import u, { useState as a } from "react";
2
- const m = typeof window < "u" ? u.useLayoutEffect : u.useEffect, y = ({
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] = a(c), [i, r] = a({});
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: i,
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 d = e({
20
+ const i = e({
21
21
  ...s,
22
22
  [t]: n
23
23
  });
24
- r(d);
24
+ r(i);
25
25
  }
26
26
  },
27
27
  setErrors: r
28
28
  };
29
29
  };
30
30
  export {
31
- y as useForm,
32
- m as useIsomorphicLayoutEffect
31
+ g as useForm,
32
+ y as useIsomorphicLayoutEffect
33
33
  };
@@ -1,3 +1,3 @@
1
- import { Props, UseFormReturnType } from "./types";
1
+ import { Props, UseFormReturnType } from './types';
2
2
  declare const useForm: <T extends object>({ initialValues, validate, }: Props<T>) => UseFormReturnType<T>;
3
3
  export default useForm;
@@ -0,0 +1,3 @@
1
+ import { useLayoutEffect } from 'react';
2
+ declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
3
+ export default useIsomorphicLayoutEffect;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbodek/hooks",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -30,8 +30,8 @@
30
30
  "react-dom": "18.2.0"
31
31
  },
32
32
  "dependencies": {
33
- "react": "^18.3.1",
34
- "react-dom": "^18.3.1"
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": "^18.3.12",
43
- "@types/react-dom": "^18.3.1",
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
  }
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect;
3
- export default useIsomorphicLayoutEffect;
File without changes
File without changes