@@ -12,7 +12,6 @@ import {
12
12
isLowPriority ,
13
13
} from '../utils/common' ;
14
14
import { FormGroupKey } from '../useFormGroup' ;
15
- import { useErrorDisplay } from './useErrorDisplay' ;
16
15
import { usePathPrefixer } from '../helpers/usePathPrefixer' ;
17
16
import { createDisabledContext } from '../helpers/createDisabledContext' ;
18
17
@@ -44,7 +43,6 @@ export type FormField<TValue> = {
44
43
setValue : ( value : TValue | undefined ) => void ;
45
44
setTouched : ( touched : boolean ) => void ;
46
45
setErrors : ( messages : Arrayable < string > ) => void ;
47
- displayError : ( ) => string | undefined ;
48
46
form ?: FormContext | null ;
49
47
} ;
50
48
@@ -64,8 +62,6 @@ export function useFormField<TValue = unknown>(opts?: Partial<FormFieldOptions<T
64
62
const { errors, setErrors, isValid, errorMessage, pathlessValidity, submitErrors, submitErrorMessage } =
65
63
useFieldValidity ( getPath , isDisabled , form ) ;
66
64
67
- const { displayError } = useErrorDisplay ( errorMessage , isTouched ) ;
68
-
69
65
const isDirty = computed ( ( ) => {
70
66
if ( ! form ) {
71
67
return ! isEqual ( fieldValue . value , initialValue ) ;
@@ -139,7 +135,6 @@ export function useFormField<TValue = unknown>(opts?: Partial<FormFieldOptions<T
139
135
setValue,
140
136
setTouched,
141
137
setErrors,
142
- displayError,
143
138
submitErrors,
144
139
submitErrorMessage,
145
140
} ;
@@ -410,11 +405,6 @@ function createLocalValidity() {
410
405
}
411
406
412
407
export type ExposedField < TValue > = {
413
- /**
414
- * Display the error message for the field.
415
- */
416
- displayError : ( ) => string | undefined ;
417
-
418
408
/**
419
409
* The error message for the field.
420
410
*/
@@ -484,7 +474,6 @@ export function exposeField<TReturns extends object, TValue>(
484
474
field : FormField < TValue > ,
485
475
) : ExposedField < TValue > & TReturns {
486
476
const exposedField = {
487
- displayError : field . displayError ,
488
477
errorMessage : field . errorMessage ,
489
478
errors : field . errors ,
490
479
submitErrors : field . submitErrors ,
0 commit comments