# give/4.18.0/src/DonationForms/resources/app/utilities/getErrorByFieldName.ts

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 6 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/DonationForms/resources/app/utilities/getErrorByFieldName.ts
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/DonationForms/resources/app/utilities/getErrorByFieldName.ts
- Modified: 2023-10-16T17:55:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.18.0/code/src/DonationForms/resources/app/utilities/getErrorByFieldName.ts#L10-L20`.

```typescript
import {FieldErrors} from 'react-hook-form';

export default function getErrorByFieldName(errors: FieldErrors, name: string): string | null {
    return errors.hasOwnProperty(name) ? (errors[name].message as any) : null;
}

```
