Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

UseFormUnregister

Unregister a field reference and remove its value.

@example
register("name", { required: true })

<button onClick={() => unregister("name")} />
// there are various keep options to retain formState
<button onClick={() => unregister("name", { keepErrors: true })} />
type UseFormUnregister<TFieldValues extends FieldValues> = (name?: FieldPath<TFieldValues> | FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[], options?: Omit<KeepStateOptions, "keepIsSubmitted" | "keepSubmitCount" | "keepValues" | "keepDefaultValues" | "keepErrors"> & {
keepValue?: boolean;
keepDefaultValue?: boolean;
keepError?: boolean;
}
) => void
;

§Type Parameters

§
TFieldValues extends FieldValues
[src]

§Type

§
(name?: FieldPath<TFieldValues> | FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[], options?: Omit<KeepStateOptions, "keepIsSubmitted" | "keepSubmitCount" | "keepValues" | "keepDefaultValues" | "keepErrors"> & {
keepValue?: boolean;
keepDefaultValue?: boolean;
keepError?: boolean;
}
) => void
[src]