Skip to content
On this page

getFieldState

this function will return the state of a field.

Type

type getFieldState = (name: string) => {
  isDirty: boolean
  isValid: boolean
  error: object
}

Props

  • name string
    • A field name to read from the form state.
register('test', { required: true })
setValue('test', 1)

getFieldState('test') // { isDirty: true, isValid: true, error: {} }