@@ -14,16 +14,15 @@ This function create the entire form state subscription and allow you to subscri
14
14
| ---------- | --------------------------- | -------------- |
15
15
| ` ...props ` | <TypeText >Object</TypeText > | ` UseFormProps ` |
16
16
17
-
18
17
### Returns
19
18
20
19
---
21
20
22
- | Name | Type | Description |
23
- | ---------- | --------------------------- | -------------- |
24
- | ` formControl ` | <TypeText >Object</TypeText > | control object for ` useForm ` hook |
25
- | ` control ` | <TypeText >Object</TypeText > | control object for ` useController ` , ` useFormState ` , ` useWatch ` |
26
- | ` ...returns ` | <TypeText >Functions</TypeText > | ` useForm ` return methods |
21
+ | Name | Type | Description |
22
+ | ------------- | ------------------------------ | ------------------------------------------------ -------------- |
23
+ | ` formControl ` | <TypeText >Object</TypeText > | control object for ` useForm ` hook |
24
+ | ` control ` | <TypeText >Object</TypeText > | control object for ` useController ` , ` useFormState ` , ` useWatch ` |
25
+ | ` ...returns ` | <TypeText >Functions</TypeText > | ` useForm ` return methods |
27
26
28
27
<Admonition type = " important" title = " Notes" >
29
28
- This function is published at ** v7.55.0-next.3** - This function is
@@ -37,7 +36,8 @@ This function create the entire form state subscription and allow you to subscri
37
36
``` tsx
38
37
const props = createFormControl ()
39
38
40
- <FormProvider { ... props } /> // ❌ You don't need provider
39
+ {" " }
40
+ <FormProvider { ... props } /> // ❌ You don't need provider
41
41
42
42
<input { ... props .register (' name' )} /> // ✅ Direct use method from createFormControl
43
43
```
@@ -90,15 +90,15 @@ const { formControl, register } = createFormControl(props)
90
90
formControl .subscribe ({
91
91
formState: {
92
92
isDirty: true ,
93
- values: true
93
+ values: true ,
94
94
},
95
95
callback : (formState ) => {
96
96
if (formState .isDirty ) {
97
97
// do something here
98
98
}
99
99
100
100
if (formState .values .test .length > 3 ) {
101
- // do something here
101
+ // do something here
102
102
}
103
103
},
104
104
})
@@ -110,7 +110,7 @@ function App() {
110
110
111
111
return (
112
112
< form>
113
- < input {... register (' test' )} / >
113
+ < input {... register (" test" )} / >
114
114
< / form>
115
115
)
116
116
}
0 commit comments