diff --git a/src/hook/index.tsx b/src/hook/index.tsx index 2722eed..aca5c57 100644 --- a/src/hook/index.tsx +++ b/src/hook/index.tsx @@ -259,16 +259,15 @@ export const useRemixForm = < return hookReturn; }; +// Derived via instantiation expression so TFieldValues flows through correctly. +// handleSubmit, reset and register have signatures that differ from UseFormReturn, +// so we capture the real return type rather than intersecting manually. export type UseRemixFormReturn< TFieldValues extends FieldValues = FieldValues, // biome-ignore lint/suspicious/noExplicitAny: defaults to any type TContext = any, TTransformedValues = TFieldValues, -> = UseFormReturn & { - handleSubmit: ReturnType["handleSubmit"]; - reset: ReturnType["reset"]; - register: ReturnType["register"]; -}; +> = ReturnType>; interface RemixFormProviderProps< TFieldValues extends FieldValues = FieldValues, // biome-ignore lint/suspicious/noExplicitAny: defaults to any type