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
|`name`| <TypeText>string \| string[]\| undefined</TypeText> | Name of the field. |
18
-
|`control`| <TypeText>Object</TypeText> |[`control`](/docs/useform/control) object provided by `useForm`. It's optional if you are using `FormProvider`. |
19
-
|`defaultValue`| <TypeText>unknown</TypeText> | default value for `useWatch` to return before the initial render.<br/><br/>**Note:** the first render will always return `defaultValue` when it's supplied. |
20
-
|`disabled`| <TypeText>boolean = false</TypeText> | Option to disable the subscription. |
21
-
|`exact`| <TypeText>boolean = false</TypeText> | This prop will enable an exact match for input name subscriptions. |
|`name`| <TypeText>string \| string[]\| undefined</TypeText> | Name of the field. |
18
+
|`control`| <TypeText>Object</TypeText> |[`control`](/docs/useform/control) object provided by `useForm`. It's optional if you are using `FormProvider`. |
19
+
|`compute`| <TypeText>function</TypeText> | <p>Subscribe to selective and computed form values.</p><ul><li>Subscribe to the entire form but only return updated value with certain condition<CodeAreawithOutCopyrawData={`const watchedValue = useWatch({\n compute: (data: FormValue) => { \n if (data.test?.length) return data.test; \n\n return ''; \n }, \n});`}/></li><li>Subscribe to a specific form value state<CodeAreawithOutCopyrawData={`const watchedValue = useWatch({\n name: 'test', \n compute: (data: string) => { \n return data.length ? data : ''; \n }, \n});`}/></li></ul> |
20
+
|`defaultValue`| <TypeText>unknown</TypeText> | default value for `useWatch` to return before the initial render.<br/><br/>**Note:** the first render will always return `defaultValue` when it's supplied. |
21
+
|`disabled`| <TypeText>boolean = false</TypeText> | Option to disable the subscription. |
22
+
|`exact`| <TypeText>boolean = false</TypeText> | This prop will enable an exact match for input name subscriptions. |
0 commit comments