Skip to content

Commit fdc1ba9

Browse files
author
Kuldeep Saxena
authored
Create Field.md
1 parent 6cfcaed commit fdc1ba9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/api/Field.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Field
2+
3+
A higher order component which subscribes a react component to a particular control's state changes i.e the component
4+
will re-render only when it's or it's parent's state changes.
5+
6+
## Props
7+
```ts
8+
control: AbstractControl;
9+
```
10+
It's a required prop to tell the `Field` that which control has to be used for subscription.
11+
You can subscribe a FormArray, FormControl and FormGroup.
12+
13+
##
14+
```ts
15+
render: (control: AbstractControl) => React.ReactElement<any>;
16+
```
17+
A callback which returns a react component which needs to be re-render whenever the control state changes.

0 commit comments

Comments
 (0)