diff --git a/dataset/react_hook_form_task/task153/combined.patch b/dataset/react_hook_form_task/task153/combined.patch index c027645..c541980 100644 --- a/dataset/react_hook_form_task/task153/combined.patch +++ b/dataset/react_hook_form_task/task153/combined.patch @@ -2,17 +2,22 @@ diff --git a/src/logic/createFormControl.ts b/src/logic/createFormControl.ts index f7079332..4fa17575 100644 --- a/src/logic/createFormControl.ts +++ b/src/logic/createFormControl.ts -@@ -1097,7 +1097,8 @@ export function createFormControl< +@@ -1097,7 +1097,13 @@ export function createFormControl< }; const handleSubmit: UseFormHandleSubmit = - (onValid, onInvalid) => async (e) => { -+ (onValid, onInvalid, options) => async (e?, context?) => { ++ (onValid, onInvalid, optionsOrOnFinally) => async (e?, context?) => { ++ // Accept onFinally as a bare function (3rd positional arg) or as ++ // options.onFinally for backward compatibility with both call styles. ++ const options = typeof optionsOrOnFinally === 'function' ++ ? { onFinally: optionsOrOnFinally } ++ : optionsOrOnFinally; + let onValidError: Error | undefined = undefined; if (e) { e.preventDefault && e.preventDefault(); e.persist && e.persist(); -@@ -1108,36 +1109,107 @@ export function createFormControl< +@@ -1108,36 +1114,107 @@ export function createFormControl< isSubmitting: true, }); @@ -182,7 +187,7 @@ index 2f20133e..c07f7e4a 100644 - onInvalid?: SubmitErrorHandler, -) => (e?: React.BaseSyntheticEvent) => Promise; + onInvalid?: SubmitErrorHandler, -+ options?: { ++ optionsOrOnFinally?: ((formState: FormState) => void | Promise) | { + onBeforeValidate?: (data: TFieldValues) => Promise | void; + onAfterValidate?: (errors: FieldErrors, data: TFieldValues) => Promise | void; + preventFocusOnError?: boolean;