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
Copy file name to clipboardExpand all lines: docs/framework/react/guides/basic-concepts.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,6 @@ const formOpts = formOptions({
24
24
})
25
25
```
26
26
27
-
More information about `formOptions` can be found at [FormOptions](../../../reference/interfaces/FormOptions.md)
28
-
29
27
## Form Instance
30
28
31
29
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
115
113
-**isDirty**: is `true` once the field's value is changed, even if it's reverted to the default. Opposite of `isPristine`
116
114
-**isPristine**: is `true` until the user changes the field's value. Opposite of `isDirty`
117
115
-**isBlurred**: is `true` once the field loses focus (is blurred)
116
+
-**isDefaultValue**: is `true` when the field's current value is the default value
-**Behavior**: A field remains 'dirty' once changed, even if reverted to the default value.
136
135
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.
138
137
139
-
-**isDefaultValue**: is `true` when the field's current value is the default value
More information on the Field API can be found at [FieldApi](../../../reference/classes/FieldApi#schema)
165
-
166
162
## Validation
167
163
168
164
`@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