Skip to content

Commit b7ef0e9

Browse files
authored
docs: fix doc issues and header consistency (#848)
* fix `field.state` code example * update h1 headers to h2 * docs: removed h1 header for linked fields, added id and title for linked fields
1 parent e1c5bee commit b7ef0e9

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

docs/framework/angular/guides/arrays.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Arrays
55

66
TanStack Form supports arrays as values in a form, including sub-object values inside of an array.
77

8-
# Basic Usage
8+
## Basic Usage
99

1010
To use an array, you can use `field.api.state.value` on an array value:
1111

docs/framework/angular/guides/basic-concepts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Each field has its own state, which includes its current value, validation statu
4141
Example:
4242

4343
```tsx
44-
const { value, error, touched, isValidating } = field.state
44+
const { value, meta: { errors, isValidating } } = field.state
4545
```
4646

4747
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.

docs/framework/react/guides/arrays.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Arrays
55

66
TanStack Form supports arrays as values in a form, including sub-object values inside of an array.
77

8-
# Basic Usage
8+
## Basic Usage
99

1010
To use an array, you can use `field.state.value` on an array value:
1111

docs/framework/react/guides/basic-concepts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Each field has its own state, which includes its current value, validation statu
8080
Example:
8181

8282
```tsx
83-
const { value, error, touched, isValidating } = field.state
83+
const { value, meta: { errors, isValidating } } = field.state
8484
```
8585

8686
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.

docs/framework/react/guides/linked-fields.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Link Two Form Fields Together
1+
---
2+
id: linked-fields
3+
title: Link Two Form Fields Together
4+
---
25

36
You may find yourself needing to link two fields together; when one is validated as another field's value has changed.
47
One such usage is when you have both a `password` and `confirm_password` field,

docs/framework/vue/guides/basic-concepts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Each field has its own state, which includes its current value, validation statu
8181
Example:
8282

8383
```js
84-
const { value, error, touched, isValidating } = field.state
84+
const { value, meta: { errors, isValidating } } = field.state
8585
```
8686

8787
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.

0 commit comments

Comments
 (0)