the path name to the form field value.
field value
Optionaloptions: SetValueConfigshould validate or update form state
// Update a single field
setValue('name', 'value', {
shouldValidate: true, // trigger validation
shouldTouch: true, // update touched fields form state
shouldDirty: true, // update dirty and dirty fields form state
});
// Update a group fields
setValue('root', {
a: 'test', // setValue('root.a', 'data')
b: 'test1', // setValue('root.b', 'data')
});
// Update a nested object field
setValue('select', { label: 'test', value: 'Test' });
Set a single field value, or a group of fields value.