getFieldState: object
This method is introduced in react-hook-form (v7.25.0) to return individual field state. It's useful in case you are trying to retrieve nested field state in a typesafe way.
Props
Name | Type | Description |
---|---|---|
name | string | registered field name. |
formState | object | When set to |
Return
Name | Type | Description |
---|---|---|
isDirty | boolean | field is modified. Condition: subscribe to |
isTouch | boolean | field has received a focus and blur event. Condition: subscribe to |
invalid | boolean | field is not valid. Condition: subscribe to |
error | undefined | FieldError | field error object. Condition: subscribe to |
Rules
name need to match registered field name.
formState will need to subscribed.
Examples
Thank you for your support
If you find React Hook Form to be useful in your project, please consider to star and support it.