UseFormResetField
Reset a field state and reference.
@example
<input {...register("firstName", { required: true })} />
<button type="button" onClick={() => resetField("firstName"))}>Reset</button>
type UseFormResetField<TFieldValues extends FieldValues> = <TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(name: TFieldName, options?: Partial<{
keepDirty: boolean;
keepTouched: boolean;
keepError: boolean;
defaultValue: FieldPathValue<TFieldValues, TFieldName>;
}>) => void;§Type Parameters
§
TFieldValues extends FieldValues
[src]