@@ -12,11 +12,13 @@ An optimized helper for reading form values. The difference between `watch` and
1212
1313---
1414
15- | Type | Description |
16- | ----------- | --------------------------------------------------------- |
17- | ` undefined ` | Returns the entire form values. |
18- | ` string ` | Gets the value at path of the form values. |
19- | ` array ` | Returns an array of the value at path of the form values. |
15+ | Name | Type | Description |
16+ | ------------ | --------------- | --------------------------------------------------------- |
17+ | ` fieldNames ` | ` undefined ` | Returns the entire form values. |
18+ | | ` string ` | Gets the value at path of the form values. |
19+ | | ` array ` | Returns an array of the value at path of the form values. |
20+ | ` config ` | ` dirtyFields ` | Returns only dirty fields |
21+ | | ` touchedFields ` | Return only touchedFields |
2022
2123** Examples:**
2224
@@ -30,12 +32,14 @@ The example below shows what to expect when you invoke `getValues` method.
3032< input {... register (" root.test2" )} / >
3133```
3234
33- | Name | Output |
34- | ------------------------------------- | ----------------------------------- |
35- | ` getValues() ` | ` { root: { test1: '', test2: ''} } ` |
36- | ` getValues("root") ` | ` { test1: '', test2: ''} ` |
37- | ` getValues("root.firstName") ` | ` '' ` |
38- | ` getValues(["yourDetails.lastName"]) ` | ` [''] ` |
35+ | Name | Output |
36+ | ----------------------------------------------- | ----------------------------------- |
37+ | ` getValues() ` | ` { root: { test1: '', test2: ''} } ` |
38+ | ` getValues("root") ` | ` { test1: '', test2: ''} ` |
39+ | ` getValues("root.firstName") ` | ` '' ` |
40+ | ` getValues(["yourDetails.lastName"]) ` | ` [''] ` |
41+ | ` getValues(undefined, { dirtyFields: true }) ` | ` { root: { test1: '', test2: ''} } ` |
42+ | ` getValues(undefined, { touchedFields: true }) ` | ` { root: { test1: '', test2: ''} } ` |
3943
4044<Admonition type = " important" title = " Rules" >
4145
0 commit comments