import { type UseFieldArrayAppend } from "https://deno.land/x/netzo@0.3.91/deps/react-hook-form.ts";
Append field/fields to the end of your fields and focus. The input value will be registered during this action.
Examples
Example 1
Example 1
<button type="button" onClick={() => append({ name: "data" })}>Append</button>
<button type="button" onClick={() => append({ name: "data" }, { shouldFocus: false })}>Append</button>
<button
type="button"
onClick={() => append([{ name: "data" }, { name: "data" }])}
>
Append
</button>
Type Parameters
TFieldValues extends FieldValues
optional
TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>definition: (value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[], options?: FieldArrayMethodProps) => void