reset the textbox on specific value of dropdown (in HandleChange()) in Redux form

32 Views Asked by At

How to reset a textbox when another dropdown field is changed in redux-form?
I tried using dispatch(change()) syntax but I keep getting the following error:

redux-form/lib/change could not be resolved

1

There are 1 best solutions below

0
user3509547 On

Finally found solution for above problem. The

redux-form/lib/change could not be resolved

error got resolved when I removed the import {change} from 'redux-form' statement. Instead now, I am passing the change from the form's props. To dynamically reset the value of Field following statement worked like charm:

dispatch(actions.change('FormName', 'FieldName', ''));

Note: Below code did not work for me:

dispatch(change('FormName', 'FieldName', ''));