I am using redux-form 7.2.0.
In my Project , I have 30 Fields in my form.
Based on the First Field Value , i need to update some 20 fields. i call change action creator for 20 times. it takes more time to render these 20 fields. very slow.
is there any way to make it fast in render?
or
is there any way to update multiple fields in single action?
please help me to rectify this
Really the only correct answer is to use an additional middleware provider. See dispatch multiple actions from Redux action creators to get an idea of the pros and cons.
You could set a flag somewhere in your state tree when the first field changes, avoid rendering via shouldComponentUpdate until all fields have been updated, then when everything has been updated, set that flag back.
The only other way I could think about handling this would be using the reducer.plugin to make a larger state change, but I think this is a dangerous path that could easily break in the future and just not behave in a predictable manner.
Currently batch field changing is not supported by redux-form or redux directly.
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