Skip to content
Source
Sign inSign up
TanStack/form

[v2] Refactor `formOptions` to allow context-based callbacks #2448

OpenLeCarbonator(GitHub profile, opens in a new tab)wants to merge 47 commits intoalpha fromopts-refactoropened

Showing 179 changed files with 38 additions and 8 deletions (loading 175).

x
0 of 179 viewed, 179 left
21 additions and 0 deletions.changeset/clear-turtles-play.mdAdded
View file
@@ -0,0 +1,21 @@
+---
+'@tanstack/angular-form': minor
+'@tanstack/form-core': minor
+'@tanstack/form-devtools': minor
+'@tanstack/lit-form': minor
+'@tanstack/preact-form': minor
+'@tanstack/react-form': minor
+'@tanstack/react-form-nextjs': minor
+'@tanstack/react-form-start': minor
+'@tanstack/solid-form': minor
+'@tanstack/svelte-form': minor
+'@tanstack/vue-form': minor
+---
+​
+BREAKING: Schemas no longer automatically send copies of field errors to the form. Use `fieldErrorTarget: 'field-and-self'` on form or group validators.
+​
+`fieldErrorTarget` can now control where schemas process errors. It has three modes:
+​
+- `'field'` (default) - Field errors are only sent to the field it targets.
+- `'field-and-self'` - Field errors are sent to the field it targets, and a copy is sent to the form array.
+- `'self'` - Fields do not receive errors, only the form.
3 additions and 2 deletionsexamples/angular/field-groups/src/bound-field.component.tsModified
View file
@@ -50,9 +50,9 @@
watchFields: this.fields().lowerBound
? [this.fields().lowerBound!]
: undefined,
- run: ({ value, parseIssues }: any) => {
+ run: ({ value }: any) => {