I am trying to make a controlled multiselect (multiselect-react-dropdown) using react-hook-form.
My problem is when I submit the form and use reset from useForm to clear the form, the selected values from before do not get added to the list as part of reset, only when I choose another option it will refresh the dropdown list and add the previous selected values:
Steps to reproduce: choose some options, press submit, open dropdown to see previous selected options missing.
Expected: previous selected options return to the dropdown right away on reset
You need to use
resetSelectedValuesusingrefas mentioned on https://www.npmjs.com/package/multiselect-react-dropdown