Skip to content

Releases: TanStack/form

v0.43.0

21 Feb 11:15
Compare
Choose a tag to compare

Version 0.43.0 - 2/21/25, 11:14 AM

PRs

  • Allow returning anything in a validator (#1104) (d8ed149) by Corbin Crutchley

The Main Showcase

This PR allows you to return non-string values from validators:

<form.Field name="password" validators={{onChange: () => ({hasUppercase: false, hasLowercase: true}) }} />

In addition, it also enforces type safety on the returned value on both errorMap and the errors array:

const form = new FormApi({
  defaultValues: {
    name: 'test',
  },
} as const)

const field = new FieldApi({
  form,
  name: 'name',
  validators: {
    onChange: () => {
      return 123 as const
    },
  },
})

assertType<123 | undefined>(field.state.meta.errorMap.onChange)

assertType<Array<123 | undefined>>(field.state.meta.errors)

Breaking Changes

  • Removes all validatorAdapters (packages, code, and props alike)
  • When using Standard Schema validators:
    • form.errors is now Record<string, StandardSchemaV1Issue[]>
    • field.errors is now StandardSchemaV1Issue[] (flattened, unless you pass disableErrorFlat in form.Field)
  • Vue 3.4 is the new minimum version
  • Vue JSX usage no longer works

Migration Guide

If you're using Yup today, you'll either need to wait for this community PR to be merged or replace Yup with another schema library.

  • If using schema validation:
    • Remove all validatorAdapter properties
    • Uninstall @tanstack/yup-form-adapter, @tanstack/valibot-form-adapter, and @tanstack/zod-form-adapter
    • Migrate all validation errors on a field away from .map(str => <p>{str}</p>) and towards .map(issue => <p>{issue.messaeg}</p>)
    • Migrate all validation errors on form away from .map(str => <p>{str}</p>) and towards .map(issueObj => <p>{issueObj.issues[0].message}</p>)
  • (If Vue): Migrate form components to use SFCs

Other Changes

  • Vue SFC Works as-intended
  • TanStack Start Adapter has been updated to new APIs

Packages

v0.42.1

20 Feb 17:25
Compare
Choose a tag to compare

Version 0.42.1 - 2/20/25, 5:25 PM

Changes

Fix

Packages

v0.42.0

13 Feb 18:45
Compare
Choose a tag to compare

Version 0.42.0 - 2/13/25, 6:44 PM

Changes

Feat

  • form-core: field meta and errors are shifted when doing array operations (990a916) by Leonardo Montini

Packages

v0.41.4

11 Feb 22:49
Compare
Choose a tag to compare

Version 0.41.4 - 2/11/25, 10:48 PM

Changes

Fix

  • form-core: skip form validation for each single field on form submit (#1147) (5f1bc0b) by Leonardo Montini

Ci

  • pin nx version to fix build (#1143) (136a584) by Leonardo Montini

Docs

  • risks of omitting useStore selector (#1126) (2bd0696) by Harry Whorlow

Packages

v0.41.3

21 Jan 18:33
Compare
Choose a tag to compare

Version 0.41.3 - 1/21/25, 6:32 PM

Changes

Fix

  • useStore without a selector should no longer crash in React (#1123) (a56d353) by Corbin Crutchley

Docs

  • Add package manager examples for TanStack Form installation (#1120) (280060a) by Sagar Dwivedi

Packages

v0.41.2

15 Jan 02:01
Compare
Choose a tag to compare

Version 0.41.2 - 1/15/25, 2:00 AM

Changes

Fix

  • meta should not regenerate every render (#1114) (08d610f) by Corbin Crutchley

Chore

  • deps: use react 19 stable, fix JSX resolution (#1113) (b60264c) by Lachlan Collins
  • deps: replace rimraf with premove, update deps (#1112) (58628f7) by Lachlan Collins
  • deps: update autofix-ci/action digest to 551dded (#1110) (3e0ef50) by renovate[bot]

Packages

v0.41.1

11 Jan 12:34
Compare
Choose a tag to compare

Version 0.41.1 - 1/11/25, 12:34 PM

Changes

Fix

  • react-form: update the name of the rendered field when it changes (b5133f2) by fuko

Packages

v0.41.0

29 Dec 16:14
Compare
Choose a tag to compare

Version 0.41.0 - 12/29/24, 4:14 PM

Changes

Feat

  • make accessing field properties faster and more stable (be7f9bf) by Corbin Crutchley

Packages

v0.40.4

17 Dec 09:17
Compare
Choose a tag to compare

Version 0.40.4 - 12/17/24, 9:16 AM

Changes

Fix

  • set fields to isBlurred only after field blur event (#940) (1f043e9) by Pascal Küsgen

Packages

v0.40.3

16 Dec 22:43
Compare
Choose a tag to compare

Version 0.40.3 - 12/16/24, 10:43 PM

Changes

Fix

  • spread field errors on form onMount validator (#1079) (ab9dd76) by Leonardo Montini

Chore

  • allow unusedLocals in standard-schema example (#1068) (91eb9ab) by Misha Kaletsky

Packages