Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/react-hook-form.ts>UseFormUnregister

Deno-powered framework for building business web apps
Go to Latest
type alias UseFormUnregister
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

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,
| "keepIsSubmitted"
| "keepSubmitCount"
| "keepValues"
| "keepDefaultValues"
| "keepErrors"
> & { keepValue?: boolean; keepDefaultValue?: boolean; keepError?: boolean; }
) => void