diff --git a/packages/react-form/src/createFormFactory.ts b/packages/react-form/src/createFormFactory.ts index 231f658cd..e5e35476c 100644 --- a/packages/react-form/src/createFormFactory.ts +++ b/packages/react-form/src/createFormFactory.ts @@ -1,4 +1,5 @@ import type { FormApi, FormOptions } from '@tanstack/form-core' + import { type UseField, type FieldComponent, Field, useField } from './useField' import { useForm } from './useForm' @@ -13,7 +14,8 @@ export function createFormFactory( ): FormFactory { return { useForm: (opts) => { - return useForm({ ...defaultOpts, ...opts } as any) as any + const formOptions = Object.assign({}, defaultOpts, opts) + return useForm(formOptions) }, useField: useField as any, Field: Field as any,