I am trying to find a lib to use for my forms, to handle validation and stuff, and I come across redux-form which seems to be the most popular one.
There is one thing that troubles me with it though. In FieldArray example https://redux-form.com/7.2.3/examples/fieldarrays/ they modify props to add/remove fields. Isn't that actually anti-pattern which conflicts with functional programming principles?
From the docs: https://redux-form.com/7.3.0/docs/api/fieldarray.md/
fields.push(value:Any) : Function
Adds a value to the end of the array. Returns nothing.
This is not a mutator; it dispatches an action which updates the state in Redux, which will cause your component to rerender.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With