Skip to content

Commit 52d5ac6

Browse files
committed
main 🧊 v0.3.15
1 parent c2c9966 commit 52d5ac6

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎packages/core/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@siberiacancode/reactuse",
3-
"version": "0.3.14",
3+
"version": "0.3.15",
44
"description": "The ultimate collection of react hooks",
55
"author": {
66
"name": "SIBERIA CAN CODE 🧊",

‎packages/core/src/bundle/hooks/useField/useField.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useRerender } from '../useRerender/useRerender';
88
*
99
* @template Value The input value
1010
* @template Type The input value type
11-
* @param {Value} [params.initialValue] Initial value
11+
* @param {Value} [params.initialValue = ""] Initial value
1212
* @param {boolean} [params.initialTouched=false] Initial touched state
1313
* @param {boolean} [params.autoFocus=false] Auto focus
1414
* @param {boolean} [params.validateOnChange=false] Validate on change
@@ -19,7 +19,7 @@ import { useRerender } from '../useRerender/useRerender';
1919
* @example
2020
* const { register, getValue, setValue, reset, dirty, error, setError, clearError, touched, focus, watch } = useField();
2121
*/
22-
export const useField = (initialValue, options) => {
22+
export const useField = (initialValue = '', options) => {
2323
const inputRef = useRef(null);
2424
const watchingRef = useRef(false);
2525
const rerender = useRerender();

‎packages/core/src/hooks/useField/useField.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export interface UseFieldReturn<Value> {
9393
*
9494
* @template Value The input value
9595
* @template Type The input value type
96-
* @param {Value} [params.initialValue] Initial value
96+
* @param {Value} [params.initialValue = ""] Initial value
9797
* @param {boolean} [params.initialTouched=false] Initial touched state
9898
* @param {boolean} [params.autoFocus=false] Auto focus
9999
* @param {boolean} [params.validateOnChange=false] Validate on change
@@ -108,7 +108,7 @@ export const useField = <
108108
Value extends boolean | number | string = string,
109109
Type = Value extends string ? string : Value extends boolean ? boolean : number
110110
>(
111-
initialValue?: Value,
111+
initialValue: Value = '' as Value,
112112
options?: UseFieldOptions
113113
): UseFieldReturn<Type> => {
114114
const inputRef = useRef<HTMLInputElement | null>(null);

‎packages/core/vite.config.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default defineConfig({
3535
...Object.keys(pkg.dependencies || {}),
3636
...Object.keys(pkg.peerDependencies || {}),
3737
"react/jsx-runtime",
38+
"react-dom/client",
3839
],
3940
output: [
4041
{

0 commit comments

Comments
 (0)