mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
10 lines
242 B
TypeScript
10 lines
242 B
TypeScript
import type { FieldError } from 'react-hook-form';
|
|
|
|
export default function getFieldErrorText(error: FieldError | undefined) {
|
|
if (!error?.message && error?.type === 'pattern') {
|
|
return 'Invalid format';
|
|
}
|
|
|
|
return error?.message;
|
|
}
|