Skip to content

Commit b4297e4

Browse files
committed
docs(form): Removed links to references and moved isDefaultValue
1 parent faf3ba1 commit b4297e4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ const formOpts = formOptions({
2424
})
2525
```
2626

27-
More information about `formOptions` can be found at [FormOptions](../../../reference/interfaces/FormOptions.md)
28-
2927
## Form Instance
3028

3129
A Form instance is an object that represents an individual form and provides methods and properties for working with the form. You create a Form instance using the `useForm` hook provided by the form options. The hook accepts an object with an `onSubmit` function, which is called when the form is submitted.
@@ -115,6 +113,7 @@ There are four states in the metadata that can be useful for seeing how the user
115113
- **isDirty**: is `true` once the field's value is changed, even if it's reverted to the default. Opposite of `isPristine`
116114
- **isPristine**: is `true` until the user changes the field's value. Opposite of `isDirty`
117115
- **isBlurred**: is `true` once the field loses focus (is blurred)
116+
- **isDefaultValue**: is `true` when the field's current value is the default value
118117

119118
```ts
120119
const { isTouched, isDirty, isPristine, isBlurred } = field.state.meta
@@ -134,9 +133,8 @@ Persistent `dirty` state
134133
- **Libraries**: Angular Form, Vue FormKit.
135134
- **Behavior**: A field remains 'dirty' once changed, even if reverted to the default value.
136135

137-
We have chosen the persistent 'dirty' state model. To also support a non-persistent 'dirty' state, we introduce an additional flag:
136+
We have chosen the persistent 'dirty' state model. However, we have introduced the `isDefaultValue` flag to also support a non-persistent 'dirty' state.
138137

139-
- **isDefaultValue**: is `true` when the field's current value is the default value
140138

141139
```ts
142140
const { isDefaultValue, isTouched } = field.state.meta
@@ -161,8 +159,6 @@ Example:
161159
/>
162160
```
163161

164-
More information on the Field API can be found at [FieldApi](../../../reference/classes/FieldApi#schema)
165-
166162
## Validation
167163

168164
`@tanstack/react-form` provides both synchronous and asynchronous validation out of the box. Validation functions can be passed to the `form.Field` component using the `validators` prop.

0 commit comments

Comments
 (0)