I want to get all values from redux-form
. I can't use formValueSelector
, because I don't know fields names (I create them dynamically). One solution is to use store.getState().form[FORM_NAME].values
, but I guess it's a dirty solution, isn't it? If so, is there another way?
One solution is to use store. getState(). form[FORM_NAME].
There is no “right” answer for this. Some users prefer to keep every single piece of data in Redux, to maintain a fully serializable and controlled version of their application at all times.
Redux-form is a really great library for working with validations. You can simply develop a lot of validations for different situations. Hence it provides validation functions to validate all the values in your form at once. You may also provide individual value validation functions for each Field or FieldArray.
There is a getFormValues
selector for that.
Or you could just get the values passed to onSubmit
during form submission.
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