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