diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/bank-ui/src/hooks/form.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/bank-ui/src/hooks/form.ts b/packages/bank-ui/src/hooks/form.ts index afa4912eb..fae11c05c 100644 --- a/packages/bank-ui/src/hooks/form.ts +++ b/packages/bank-ui/src/hooks/form.ts @@ -72,6 +72,7 @@ function constructFormHandler<T>( updateForm: (d: FormValues<T>) => void, errors: FormErrors<T> | undefined, ): FormHandler<T> { + const keys = Object.keys(form) as Array<keyof T>; const handler = keys.reduce((prev, fieldName) => { @@ -102,6 +103,14 @@ function constructFormHandler<T>( return handler; } +/** + * FIXME: Consider sending this to web-utils + * + * + * @param defaultValue + * @param check + * @returns + */ export function useFormState<T>( defaultValue: FormValues<T>, check: (f: FormValues<T>) => FormStatus<T>, |