You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*(1) For nested arrays, react-hook-form requires you [to cast the field array by its name](https://react-hook-form.com/docs/usefieldarray) if you're using TypeScript
\*(1) For nested arrays, react-hook-form requires you [to cast the field array by its name](https://react-hook-form.com/docs/usefieldarray) if you're using TypeScript
There are three field states can be very useful to see how the user interacts with a field. A field is _"touched"_ when the user clicks/tabs into it, _"pristine"_ until the user changes value in it, and _"dirty"_ after the value has been changed. You can check these states via the `isTouched`, `isPristine` and `isDirty` flags, as seen below.
Copy file name to clipboardExpand all lines: docs/framework/angular/guides/validation.md
+2-5
Original file line number
Diff line number
Diff line change
@@ -237,9 +237,6 @@ export class AppComponent {
237
237
}
238
238
```
239
239
240
-
241
-
242
-
243
240
## Validation at field level vs at form level
244
241
245
242
As shown above, each `[tanstackField]` accepts its own validation rules via the `onChange`, `onBlur` etc... callbacks. It is also possible to define validation rules at the form level (as opposed to field by field) by passing similar callbacks to the `injectForm()` function.
@@ -425,11 +422,12 @@ While functions provide more flexibility and customization over your validation,
425
422
### Standard Schema Libraries
426
423
427
424
TanStack Form natively supports all libraries following the [Standard Schema specification](https://github.com/standard-schema/standard-schema), most notably:
425
+
428
426
-[Zod](https://zod.dev/)
429
427
-[Valibot](https://valibot.dev/)
430
428
-[ArkType](https://arktype.io/)
431
429
432
-
*Note:* make sure to use the latest version of the schema libraries as older versions might not support Standard Schema yet.
430
+
_Note:_ make sure to use the latest version of the schema libraries as older versions might not support Standard Schema yet.
433
431
434
432
To use schemas from these libraries you can pass them to the `validators` props as you would do with a custom function:
435
433
@@ -466,7 +464,6 @@ export class AppComponent {
466
464
467
465
Async validations on form and field level are supported as well:
Copy file name to clipboardExpand all lines: docs/framework/lit/guides/basic-concepts.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,10 @@ For Example:
87
87
Each field has its own state, which includes its current value, validation status, error messages, and other metadata. You can access a field's state using its `field.state` property.
There are three field states can be very useful to see how the user interacts with a field. A field is _"touched"_ when the user clicks/tabs into it, _"pristine"_ until the user changes value in it, and _"dirty"_ after the value has been changed. You can check these states via the `isTouched`, `isPristine` and `isDirty` flags, as seen below.
Copy file name to clipboardExpand all lines: docs/framework/react/community/balastrong-tutorial.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,6 @@ TanStack Form maintainer [Balastrong](https://bsky.app/profile/leonardomontini.d
7
7
8
8
[Watch the full playlist](https://www.youtube.com/playlist?list=PLOQjd5dsGSxInTKUWTxyqSKwZCjDIUs0Y)
9
9
10
-
11
10
## 1. [Setup and validation](https://youtu.be/Pf1qn35bgjs)
12
11
13
12
The first steps into TanStack Form learning all the basics, from setting up the library to creating a simple form with text fields and validation (sync, debounced and async). [Watch video (8:16)](https://youtu.be/Pf1qn35bgjs)
@@ -30,4 +29,4 @@ Use schema libraries like zod, yup or valibot to define your schema with validat
30
29
31
30
## 6. [Side effects and listeners](https://youtu.be/A-w2IG7DAso)
32
31
33
-
Similarly to field validators, you can attach events to field listeners and react to them, for example to reset a field when another one it depends on has changed. [Watch video (5:50)](https://youtu.be/A-w2IG7DAso)
32
+
Similarly to field validators, you can attach events to field listeners and react to them, for example to reset a field when another one it depends on has changed. [Watch video (5:50)](https://youtu.be/A-w2IG7DAso)
There are three field states can be very useful to see how the user interacts with a field. A field is _"touched"_ when the user clicks/tabs into it, _"pristine"_ until the user changes value in it, and _"dirty"_ after the value has been changed. You can check these states via the `isTouched`, `isPristine` and `isDirty` flags, as seen below.
> In RHF, `isDirty = true`, when the form's values are different from the original values. If the user changes the values in a form, and then changes them again to end up with values that match the form's default values, `isDirty` will be `false` in RHF, but `true` in `TanStack/form`.
96
99
> The default values are exposed both on the form's and the field's level in `TanStack/form` (`form.options.defaultValues`, `field.options.defaultValue`), so you can write your own `isDefaultValue()` helper if you need to emulate RHF's behavior.`
97
100
98
-
99
101
## Field API
100
102
101
103
The Field API is an object passed to the render prop function when creating a field. It provides methods for working with the field's state.
@@ -209,7 +211,7 @@ It is important to remember that while the `useStore` hook's `selector` prop is
0 commit comments