import { type UseFormUnregister } from "https://deno.land/x/netzo@0.3.91/deps/react-hook-form.ts";
Unregister a field reference and remove its value.
Examples
Example 1
Example 1
register("name", { required: true })
<button onClick={() => unregister("name")} />
// there are various keep options to retain formState
<button onClick={() => unregister("name", { keepErrors: true })} />
Type Parameters
TFieldValues extends FieldValues
definition: (name?: FieldPath<TFieldValues> | FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[], options?: Omit<KeepStateOptions, > & { keepValue?: boolean; keepDefaultValue?: boolean; keepError?: boolean; }) => void
| "keepIsSubmitted"
| "keepSubmitCount"
| "keepValues"
| "keepDefaultValues"
| "keepErrors"