Skip to content

Commit

Permalink
refactor: change form options spread to object assign
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielModog committed Aug 31, 2023
1 parent 74a1dab commit 8a3e872
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 8a3e872

Please sign in to comment.