Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
type alias UseFormGetFieldState
import { type UseFormGetFieldState } from "https://deno.land/x/netzo@0.5.14/deps/react-hook-form.ts";

This method will return individual field states. It will be useful when you are trying to retrieve the nested value field state in a typesafe approach.

Examples

Example 1

// those formState has to be subscribed
const { formState: { dirtyFields, errors, touchedFields } } = formState();
getFieldState('name')
// Get field state when form state is not subscribed yet
getFieldState('name', formState)

// It's ok to combine with useFormState
const formState = useFormState();
getFieldState('name')
getFieldState('name', formState)

Type Parameters

TFieldValues extends FieldValues
definition: <TFieldName extends FieldPath<TFieldValues>>(name: TFieldName, formState?: FormState<TFieldValues>) => { invalid: boolean; isDirty: boolean; isTouched: boolean; error?: FieldError; }