Skip to content

Commit

Permalink
refactor: change form options spread to object assign (#421)
Browse files Browse the repository at this point in the history
Co-authored-by: Corbin Crutchley <git@crutchcorn.dev>
  • Loading branch information
GabrielModog and crutchcorn authored Sep 2, 2023
1 parent 4cb1225 commit 6eca66e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-form/src/createFormFactory.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -13,7 +14,8 @@ export function createFormFactory<TFormData>(
): FormFactory<TFormData> {
return {
useForm: (opts) => {
return useForm<TFormData>({ ...defaultOpts, ...opts } as any) as any
const formOptions = Object.assign({}, defaultOpts, opts)
return useForm<TFormData>(formOptions)
},
useField: useField as any,
Field: Field as any,
Expand Down

0 comments on commit 6eca66e

Please sign in to comment.