getFieldError
getFieldError(
error,fieldName):string|undefined
Defined in: react/src/validation.ts:133
Gets error message for a specific field from a ValidationError.
Returns undefined if no error exists for that field. Pass "" for issues
about the whole argument (an empty path), the key mapValidationErrors
files them under.
Parameters
Section titled “Parameters”fieldName
Section titled “fieldName”string
Returns
Section titled “Returns”string | undefined
Example
Section titled “Example”if (isValidationError(error)) { const toError = getFieldError(error, "to") const amountError = getFieldError(error, "amount")}