github TanStack/form v0.23.0

latest releases: @tanstack/lit-form@1.23.0, @tanstack/vue-form@1.23.0, @tanstack/svelte-form@1.23.0...
15 months ago

Version 0.23.0 - 6/20/24, 3:35 AM

Changes

Feat

  • add formOptions API, add new exports from @tanstack/react-form/nextjs, remove createFormFactory (a9e3852) by Corbin Crutchley

This version changes a fair bit if you are using the following APIs:

  • formFactory (React, Vue, Lit, Solid)
  • onServerValidate (React)

formFactory

If you are using a formFactory API, please remove it in favor of the new formOptions function.

// Old
const formFactory = createFormFactory<Person>({
  defaultValues: {
    firstName: '',
    lastName: '',
    hobbies: [],
  },
})

formFactory.useForm({})

// New
const formOpts = formOptions<Person>({
  defaultValues: {
    firstName: '',
    lastName: '',
    hobbies: [],
  },
})

useForm(formOpts)

While not a 1:1 API, we believe that any existing usages of formFactory are better suited for formOptions

onServerValidate

Instead of using onServerValidate on a formFactory, you'll want to follow our new SSR guidance:

https://tanstack.com/form/latest/docs/framework/react/guides/ssr

You can see the diff of the old SSR guide and the new one here:

a9e3852#diff-7589cfcbf048311003c3cdc2e48d40fe17dbb21a88c1070695758e43f8efe898

Packages

  • @tanstack/form-core@0.23.0
  • @tanstack/react-form@0.23.0
  • @tanstack/vue-form@0.23.0
  • @tanstack/solid-form@0.23.0
  • @tanstack/lit-form@0.23.0
  • @tanstack/angular-form@0.23.0
  • @tanstack/zod-form-adapter@0.23.0
  • @tanstack/yup-form-adapter@0.23.0
  • @tanstack/valibot-form-adapter@0.23.0

Don't miss a new form release

NewReleases is sending notifications on new releases.