react-hook-form 7.41.0
[7.41.0] - 2022-12-17
Added
useFormaddedvaluesprops
const values = await fetch('API');
useForm({
values, // will reset the form when values updates
// resetOptions: {
// keepDirtyValues: true
// }
});
- new
isLoadingformState for asyncdefaultValues
const {
formState: { isLoading },
} = useForm();
Changed
useFormsupport asyncdefaultValuesprops
const {
formState: { isLoading },
} = useForm({
defaultValues: fetch('API'),
// resetOptions: {
// keepDirtyValues: true
// }
});