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
It's a library inspired by the [Angular's Reactive Forms](https://angular.io/guide/reactive-forms), which allows to create a tree of form control objects in the component class and bind them with native form control elements.
8
22
@@ -317,7 +331,10 @@ Its an another performance booster in RRF, it just holds the computation needed
317
331
318
332
Yes, this library works with react-native also, currently it supports react-native `TextInput` and `Switch` component.
319
333
334
+
### Note:
335
+
If you're using react-native then please add the following line of code in `index.js` of your project to avoid error in android devices.
320
336
337
+
`import "babel-polyfill"`
321
338
322
339
323
340
Let's make React Reactive Forms better! If you're interested in helping, all contributions are welcome and appreciated.
Copy file name to clipboardExpand all lines: docs/GettingStarted.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ The above example will create an instance of [FormGroup](FormGroup.md) class whi
63
63
64
64
65
65
### step2: Connect form with component
66
-
This steps is not needed if you're using dynamic controls but if you want a better control over your form state then you should do that, if your controls are dynamic then you can also initalize the empty group control and add the controls later.
66
+
This step is not needed if you're using dynamic controls but if you want a better control over your form state then you should do that, if your controls are dynamic then you can also initalize the empty group control and add the controls later.
@@ -42,79 +41,103 @@ const loginForm = new FormGroup({
42
41
})
43
42
```
44
43
44
+
#### Without initializing the controls ( Dynamic Controls )
45
+
46
+
You can also create controls without even initializing the group control object with the help of new react form components ( [FieldGroup](api/FieldGroup.md), [FieldControl](api/FieldControl.md), [FieldArray](api/FieldArray.md)).
47
+
48
+
For eg.
49
+
50
+
```ts
51
+
<FieldGroup
52
+
render={({ value }) => (
53
+
<form>
54
+
<FieldControl
55
+
name="test"
56
+
render={({ handler }) => <input {...handler()}/>}
57
+
/>
58
+
<pre>{value.toString()}</pre>
59
+
</form>)}
60
+
/>
61
+
```
62
+
The above example will create an instance of [FormGroup](FormGroup.md) class which has a control named `test`.
63
+
64
+
45
65
### step2: Connect form with component
46
-
[Field](api/Field.md) component subscribes a particular control & only update it when it’s or it’s parent’s state changes, which improves the performance by restricting the unnecessary re-rendering of other fields.
66
+
This steps is not needed if you're using dynamic controls but if you want a better control over your form state then you should do that, if your controls are dynamic then you can also initalize the empty group control and add the controls later.
67
+
Example:
47
68
48
69
```js
49
70
importReact, { Component } from'react';
50
-
import { FormBuilder, Validators, Field } from"react-reactive-form";
0 commit comments