Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount committed Nov 17, 2024
1 parent 9b8fe6d commit bdde9a2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function mapValueOnEvent(value: unknown) {
* Otherwise you'll be fired
*/
export function useForm<Schema extends types.TSchema, SubmitResult = void>(
optionsOrFormInstance: types.UseFormProps<Schema, SubmitResult> | types.UseFormReturn<Schema>,
optionsOrFormInstance: types.UseFormOptions<Schema, SubmitResult> | types.UseFormReturn<Schema>,
): types.UseFormReturn<Schema> {
const { getText } = useText()
const [initialTypePassed] = React.useState(() => getArgsType(optionsOrFormInstance))
Expand Down Expand Up @@ -242,7 +242,7 @@ export function useForm<Schema extends types.TSchema, SubmitResult = void>(

/** Get the type of arguments passed to the useForm hook */
function getArgsType<Schema extends types.TSchema, SubmitResult = void>(
args: types.UseFormProps<Schema, SubmitResult>,
args: types.UseFormOptions<Schema, SubmitResult>,
) {
return 'formState' in args ? ('formInstance' as const) : ('formOptions' as const)
}

0 comments on commit bdde9a2

Please sign in to comment.