string \| string[] \| undefined | Name of the field. |
-| `control` | Object | [`control`](/docs/useform/control) object provided by `useForm`. It's optional if you are using `FormProvider`. |
-| `defaultValue` | unknown | default value for `useWatch` to return before the initial render.
**Note:** the first render will always return `defaultValue` when it's supplied. |
-| `disabled` | boolean = false | Option to disable the subscription. |
-| `exact` | boolean = false | This prop will enable an exact match for input name subscriptions. |
+| Name | Type | Description |
+| -------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `name` | string \| string[] \| undefined | Name of the field. |
+| `control` | Object | [`control`](/docs/useform/control) object provided by `useForm`. It's optional if you are using `FormProvider`. |
+| `compute` | function | Subscribe to selective and computed form values.
- Subscribe to the entire form but only return updated value with certain condition { \n if (data.test?.length) return data.test; \n\n return ''; \n }, \n});`}/>
- Subscribe to a specific form value state { \n return data.length ? data : ''; \n }, \n});`}/>
|
+| `defaultValue` | unknown | default value for `useWatch` to return before the initial render.
**Note:** the first render will always return `defaultValue` when it's supplied. |
+| `disabled` | boolean = false | Option to disable the subscription. |
+| `exact` | boolean = false | This prop will enable an exact match for input name subscriptions. |
### Return
diff --git a/src/content/ts.mdx b/src/content/ts.mdx
index aede486a2..da74ce935 100644
--- a/src/content/ts.mdx
+++ b/src/content/ts.mdx
@@ -96,12 +96,13 @@ type FormValues = {
export default function App() {
const { register, handleSubmit } = useForm()
const onSubmit: SubmitHandler = (data) => console.log(data)
- const onError: SubmitErrorHandler = (errors) => console.log(errors);
+ const onError: SubmitErrorHandler = (errors) =>
+ console.log(errors)
return (