import { type UseFieldArrayInsert } from "https://deno.land/x/netzo@0.4.72/deps/react-hook-form.ts";
Insert field/fields at particular position and focus.
Examples
Example 1
Example 1
<button type="button" onClick={() => insert(1, { name: "data" })}>Insert</button>
<button type="button" onClick={() => insert(1, { name: "data" }, { shouldFocus: false })}>Insert</button>
<button
type="button"
onClick={() => insert(1, [{ name: "data" }, { name: "data" }])}
>
Insert
</button>
Type Parameters
optional
TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>definition: () => void
index: number,
value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[],
options?: FieldArrayMethodProps,