mirror of
https://github.com/cupcakearmy/formhero.git
synced 2025-09-05 22:00:39 +00:00
rename auto to field
This commit is contained in:
@@ -88,10 +88,10 @@ export const useForm = <T, U extends { [key in keyof T]: useFormValidatorParamet
|
||||
_validate(key, extracted)
|
||||
}
|
||||
|
||||
const auto = (key: keyof T, opts: useFormOptions = {}) => ({
|
||||
const field = (key: keyof T, opts: useFormOptions = {}) => ({
|
||||
[opts.getter || options.getter || 'onChange']: update(key, opts.extractor),
|
||||
[opts.setter || options.setter || 'value']: form[key] as any,
|
||||
})
|
||||
|
||||
return { form, update, auto, errors, isValid }
|
||||
return { form, update, field, errors, isValid }
|
||||
}
|
||||
|
Reference in New Issue
Block a user