Skip to content

Commit

Permalink
Merge pull request #107 from raulfdm/main
Browse files Browse the repository at this point in the history
Make event on handleSubmit function optional to match react-hook-form
  • Loading branch information
AlemTuzlak authored Jul 31, 2024
2 parents 6bc677d + 063c0a7 commit 798fa3a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/hook/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ import {
type SubmitErrorHandler,
type SubmitHandler,
useFormContext,
useForm,
FormProvider,
type DefaultValues,
type FieldValues,
type FormState,
type KeepStateOptions,
type Path,
type RegisterOptions,
type UseFormHandleSubmit,
type UseFormProps,
type UseFormReturn,
} from "react-hook-form";
import { useForm, FormProvider } from "react-hook-form";
import type {
DefaultValues,
FieldValues,
FormState,
KeepStateOptions,
Path,
RegisterOptions,
UseFormHandleSubmit,
UseFormProps,
UseFormReturn,
} from "react-hook-form";

import { createFormData } from "../utilities";

export type SubmitFunctionOptions = Parameters<SubmitFunction>[1];
Expand Down Expand Up @@ -189,7 +189,7 @@ export const useRemixForm = <T extends FieldValues>({
);

const handleSubmit = useMemo(
() => (e: FormEvent<HTMLFormElement>) => {
() => (e?: FormEvent<HTMLFormElement>) => {
const encType = e?.currentTarget?.enctype as FormEncType | undefined;
const method = e?.currentTarget?.method as FormMethod | undefined;
const onValidHandler = submitHandlers?.onValid ?? onSubmit;
Expand Down

0 comments on commit 798fa3a

Please sign in to comment.