react-simplikit 0.0.37 → 0.0.38

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.
@@ -8,18 +8,16 @@ import { ChangeEventHandler } from 'react';
8
8
  * @param {(value: string) => string} [transformValue=(v: string) => v] - A function to transform the input value.
9
9
  * Defaults to an identity function that returns the input unchanged.
10
10
  *
11
- * @returns {[value: string, onChange: (value: string) => void]} A tuple containing:
11
+ * @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement>]} A tuple containing:
12
12
  * - value `string` - The current state value;
13
- * - onChange `(value: string) => void` - A function to update the state;
13
+ * - onChange `ChangeEventHandler<HTMLInputElement>` - A function to update the state;
14
14
  *
15
15
  * @example
16
16
  * function Example() {
17
- * const [value, setValue] = useInputState('');
18
- * return <input type="text" value={value} onChange={setValue} />;
17
+ * const [value, onChange] = useInputState('');
18
+ * return <input type="text" value={value} onChange={onChange} />;
19
19
  * }
20
20
  */
21
- declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<HTMLElement & {
22
- value: string;
23
- }>];
21
+ declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<HTMLInputElement>];
24
22
 
25
23
  export { useInputState };
@@ -8,18 +8,16 @@ import { ChangeEventHandler } from 'react';
8
8
  * @param {(value: string) => string} [transformValue=(v: string) => v] - A function to transform the input value.
9
9
  * Defaults to an identity function that returns the input unchanged.
10
10
  *
11
- * @returns {[value: string, onChange: (value: string) => void]} A tuple containing:
11
+ * @returns {[value: string, onChange: ChangeEventHandler<HTMLInputElement>]} A tuple containing:
12
12
  * - value `string` - The current state value;
13
- * - onChange `(value: string) => void` - A function to update the state;
13
+ * - onChange `ChangeEventHandler<HTMLInputElement>` - A function to update the state;
14
14
  *
15
15
  * @example
16
16
  * function Example() {
17
- * const [value, setValue] = useInputState('');
18
- * return <input type="text" value={value} onChange={setValue} />;
17
+ * const [value, onChange] = useInputState('');
18
+ * return <input type="text" value={value} onChange={onChange} />;
19
19
  * }
20
20
  */
21
- declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<HTMLElement & {
22
- value: string;
23
- }>];
21
+ declare function useInputState(initialValue?: string, transformValue?: (value: string) => string): readonly [string, ChangeEventHandler<HTMLInputElement>];
24
22
 
25
23
  export { useInputState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simplikit",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "main": "./dist/index.cjs",
5
5
  "type": "module",
6
6
  "sideEffects": false,