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: src/content/docs/usewatch/watch.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,31 +20,31 @@ A React Hook Form component that provides the same functionality as `useWatch`,
20
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
21
|`disabled`| <TypeText>boolean = false</TypeText> | Option to disable the subscription. |
22
22
|`exact`| <TypeText>boolean = false</TypeText> | This prop will enable an exact match for input name subscriptions. |
23
-
|`render`| <TypeText>Function</TypeText> | Subscribes to specified form field(s) and re-renders its child function whenever the values change. This allows you to declaratively consume form values in JSX without manually wiring up state.|
23
+
|`render`| <TypeText>Function</TypeText> | Subscribes to specified form field(s) and re-renders its child function whenever the values change. This allows you to declaratively consume form values in JSX without manually wiring up state. |
24
24
25
25
**Examples:**
26
26
27
27
---
28
28
29
29
```tsx copy sandbox=""
30
-
import { useForm, Watch } from'react-hook-form';
30
+
import { useForm, Watch } from"react-hook-form"
31
31
32
32
const App = () => {
33
-
const { register, control } =useForm();
33
+
const { register, control } =useForm()
34
34
35
35
return (
36
36
<div>
37
37
<form>
38
-
<input{...register('foo')} />
39
-
<input{...register('bar')} />
38
+
<input{...register("foo")} />
39
+
<input{...register("bar")} />
40
40
</form>
41
41
{/* re-render only when value of `foo` changes */}
0 commit comments