getFieldErrors
getFieldErrors(
error,fieldName):string[]
Defined in: react/src/validation.ts:154
Gets all error messages for a specific field from a ValidationError.
Returns empty array if no errors exist for that field. Pass "" for issues
about the whole argument (an empty path).
Parameters
Section titled “Parameters”fieldName
Section titled “fieldName”string
Returns
Section titled “Returns”string[]
Example
Section titled “Example”if (isValidationError(error)) { const amountErrors = getFieldErrors(error, "amount") // ["Amount is required", "Amount must be positive"]}