react-simple-formkit 2.1.6 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -200,14 +200,14 @@ State updates only when observed via `watch()`, `useWatch()`, `subscribe()`, or
|
|
|
200
200
|
|
|
201
201
|
The `watch` function (and `useWatch`, `subscribe`) is the "brain" of your form. Instead of having multiple hooks for different states, you can observe anything in the form using a unified dot-notation syntax:
|
|
202
202
|
|
|
203
|
-
| Target | Syntax Example |
|
|
204
|
-
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
205
|
-
| **All Values** | `watch()` |
|
|
206
|
-
| **Specific Value** | `watch("email")` |
|
|
207
|
-
| **Form State** | `watch("formState")` <br/> `watch("formState.isDirty")` <br/> `watch("formState.isError")` <br/> `watch("formState.dirtyFields")` <br/> `watch("formState.touchedFields")` <br/> `watch("formState.errorFields")` |
|
|
208
|
-
| **Field States** | `watch("fieldStates")` <br/> `watch("fieldStates.email")` <br/> `watch("fieldStates.email.isDirty")` <br/> `watch("fieldStates.email.isTouched")` <br/> `watch("fieldStates.email.isError")` <br/> `watch("fieldStates.email.customState")` <br/> |
|
|
209
|
-
| **Errors** | `watch("errors")` <br/> `watch("errors.email")` <br/> |
|
|
210
|
-
| **Multiple values** | `watch(["email", "errors.email", "fieldStates.email", "formState.isDirty"])` <br/> |
|
|
203
|
+
| Target | Syntax Example |
|
|
204
|
+
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
205
|
+
| **All Values** | `watch()` |
|
|
206
|
+
| **Specific Value** | `watch("email")` |
|
|
207
|
+
| **Form State** | `watch("formState")` <br/> `watch("formState.isDirty")` <br/> `watch("formState.isError")` <br/> `watch("formState.dirtyFields")` <br/> `watch("formState.touchedFields")` <br/> `watch("formState.errorFields")` |
|
|
208
|
+
| **Field States** | `watch("fieldStates")` <br/> `watch("fieldStates.email")` <br/> `watch("fieldStates.email.isDirty")` <br/> `watch("fieldStates.email.isTouched")` <br/> `watch("fieldStates.email.isError")` <br/> `watch("fieldStates.email.customState")` <br/> |
|
|
209
|
+
| **Errors** | `watch("errors")` <br/> `watch("errors.email")` <br/> |
|
|
210
|
+
| **Multiple values** | `watch(["email", "errors.email", "fieldStates.email", "formState.isDirty"])` <br/> |
|
|
211
211
|
|
|
212
212
|
> **💡Why it matters\*:** This unified approach ensures you only need to learn one API to track the entire lifecycle of your form.
|
|
213
213
|
|