Major Changes
- Release the first alpha of TanStack Form v2.
Minor Changes
-
#2419
584fcd9- Restorefield.replaceValue()and addform.replaceFieldValue()for replacing an array element in place -
Feature: Specify default options for
createFormHook -
#2426
395d61c- BREAKING:schemaOutputsno longer exists. It is superceded byvalidatorOutputs. This is only a name change, the schema's result is the same as beforevalidatorOutputsnow allows a callback validator to specify data that the submit function should know. Schemas do this
automatically, but now you can do it manually as well:
run: ({ createOutput }) => createOutput('This is not a validation error and onSubmit can use this')The current map is:
Validator onSubmit: ({ validatorOutputs }) => ...Schema Schema's output data createOutput(X)XDefault callback validator undefinedValidation error N/A, onSubmitdoesn't run -
#2365
f8bbc25- Feat: Field groups may now omit identity bindings likefields={{ a: 'a' }}
Patch Changes
-
Refactor: Adapter
formOptions/appFormOptionsno longer shim the core types and runtime.BREAKING:
formOptions.looseSchemaandformOptions.strictSchemanow require a schema as
first parameter. This locks down inference to get the best type safety out of it vs. the options object alone.Fix:
formOptions.looseSchemanow allowsdefaultValuesto omit properties instead of
requiring them to be explicitly undefined. -
Docs: Add JSDoc to code and API sections to website
-
Fix: Schema output type now properly guards against dynamically enabled validators
-
Fix: Subscription selectors now infer tuple return values without requiring
as const. -
Refactor: Use stable validator identity instead of index
-
Refactor: Use stable listener identity instead of index
-
Refactor: Store Form Groups on trie nodes instead of the form instance