MCPcopy Create free account
hub / github.com/react-hook-form/react-hook-form / getFieldState

Function getFieldState

src/logic/createFormControl.ts:1089–1098  ·  view source on GitHub ↗
(
    name,
    formState,
  )

Source from the content-addressed store, hash-verified

1087 };
1088
1089 const getFieldState: UseFormGetFieldState<TFieldValues> = (
1090 name,
1091 formState,
1092 ) => ({
1093 invalid: !!get((formState || _formState).errors, name),
1094 isDirty: !!get((formState || _formState).dirtyFields, name),
1095 error: get((formState || _formState).errors, name),
1096 isValidating: !!get(_formState.validatingFields, name),
1097 isTouched: !!get((formState || _formState).touchedFields, name),
1098 });
1099
1100 const clearErrors: UseFormClearErrors<TFieldValues> = (name) => {
1101 const names = name ? convertToArrayPayload(name) : undefined;

Callers 7

form.test-d.tsFile · 0.85
AppFunction · 0.85
useForm.test.tsxFile · 0.85
AppFunction · 0.85
AppFunction · 0.85
trigger.test.tsxFile · 0.85
OutputFunction · 0.85

Calls

no outgoing calls

Tested by 4

AppFunction · 0.68
AppFunction · 0.68
AppFunction · 0.68
OutputFunction · 0.68