1

I have form with select dropdown, checkboxes and text fields. When I read redux documentation for reseting fields it gives more than 1 way to clear fields - https://redux-form.com/6.0.0-alpha.4/docs/faq/howtoclear.md/

In my situation formvalues are tied to dropdown selection. And I am trying to remove dropdown selection on reset if possible. But that is not possible. So I tried using (c) and (d) ways from the redux document, but they reset it to older values and they do not clear all fields like select drop down do not reset to default selection. The first 2 ways are too complicated for something as simple as resetting.

This is my code where I implemented reset -

const { handleSubmit, reset, errors, submitCallback } = props //....other code //....other code const clearAll = () => { props.dispatch(reset('myForm')); }; 

This resets my form to previous selection and do clear fields. What am I doing wrong?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.