File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -613,8 +613,8 @@ export type FormComponentProps = Partial<
613613export type FormComponentMethods = {
614614 clearErrors : ( ...fields : string [ ] ) => void
615615 resetAndClearErrors : ( ...fields : string [ ] ) => void
616- setError ( field : string , value : string ) : void
617- setError ( errors : Record < string , string > ) : void
616+ setError ( field : string , value : ErrorValue ) : void
617+ setError ( errors : Record < string , ErrorValue > ) : void
618618 reset : ( ...fields : string [ ] ) => void
619619 submit : ( ) => void
620620 defaults : ( ) => void
@@ -625,7 +625,7 @@ export type FormComponentMethods = {
625625export type FormComponentonSubmitCompleteArguments = Pick < FormComponentMethods , 'reset' | 'defaults' >
626626
627627export type FormComponentState = {
628- errors : Record < string , string >
628+ errors : Record < string , ErrorValue >
629629 hasErrors : boolean
630630 processing : boolean
631631 progress : Progress | null
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ export default function useForm<TForm extends FormDataType<TForm>>(
293293 )
294294
295295 const setError = useCallback (
296- ( fieldOrFields : FormDataKeys < TForm > | FormDataErrors < TForm > , maybeValue ?: string ) => {
296+ ( fieldOrFields : FormDataKeys < TForm > | FormDataErrors < TForm > , maybeValue ?: ErrorValue ) => {
297297 setErrors ( ( errors ) => {
298298 const newErrors = {
299299 ...errors ,
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export default function useForm<TForm extends FormDataType<TForm>>(
7171 const inputData = ( typeof rememberKeyOrData === 'string' ? maybeData : rememberKeyOrData ) ?? { }
7272 const data : TForm = typeof inputData === 'function' ? inputData ( ) : ( inputData as TForm )
7373 const restored = rememberKey
74- ? ( router . restore ( rememberKey ) as { data : TForm ; errors : Record < FormDataKeys < TForm > , string > } | null )
74+ ? ( router . restore ( rememberKey ) as { data : TForm ; errors : Record < FormDataKeys < TForm > , ErrorValue > } | null )
7575 : null
7676 let defaults = cloneDeep ( data )
7777 let cancelToken : CancelToken | null = null
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export default function useForm<TForm extends FormDataType<TForm>>(
6161 const rememberKey = typeof rememberKeyOrData === 'string' ? rememberKeyOrData : null
6262 const data = ( typeof rememberKeyOrData === 'string' ? maybeData : rememberKeyOrData ) ?? { }
6363 const restored = rememberKey
64- ? ( router . restore ( rememberKey ) as { data : TForm ; errors : Record < FormDataKeys < TForm > , string > } )
64+ ? ( router . restore ( rememberKey ) as { data : TForm ; errors : Record < FormDataKeys < TForm > , ErrorValue > } )
6565 : null
6666 let defaults = typeof data === 'function' ? cloneDeep ( data ( ) ) : cloneDeep ( data )
6767 let cancelToken : CancelToken | null = null
You can’t perform that action at this time.
0 commit comments