getFieldErrors
getFieldErrors(
error,fieldName):string[]
Defined in: react/src/validation.ts:130
Gets all error messages for a specific field from a ValidationError. Returns empty array if no errors exist for that field.
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"]}