Skip to content
IC Reactor

getFieldError

getFieldError(error, fieldName): string | undefined

Defined in: react/src/validation.ts:110

Gets error message for a specific field from a ValidationError. Returns undefined if no error exists for that field.

ValidationError

string

string | undefined

if (isValidationError(error)) {
const toError = getFieldError(error, "to")
const amountError = getFieldError(error, "amount")
}