UseFieldArrayInsert
Insert field/fields at particular position and focus.
@example
<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 UseFieldArrayInsert<TFieldValues extends FieldValues, TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>> = (
index: number,
value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[],
options?: FieldArrayMethodProps,
) => void;§Type Parameters
§
TFieldValues extends FieldValues
[src]§
TFieldArrayName extends FieldArrayPath<TFieldValues> = FieldArrayPath<TFieldValues>
[src]§Type
§
(index: number, value: FieldArray<TFieldValues, TFieldArrayName> | FieldArray<TFieldValues, TFieldArrayName>[], options?: FieldArrayMethodProps) => void
[src]