I have an array of dropdowns rendered by useFieldArray() from react-form-hook and mapped to react to jsx.
The trick is to remove options from all dropdowns that are already selected.
So if there's 3 dropdowns that have array of options:
[ 'apple', 'banana', 'pineapple', 'pear', 'mango' ]
AND
1st dropdown: has apple selected
2nd: banana
3rd: pineapple
Dropdown options of all three would just show ['pear', 'mango' ] since the rest is selected.
What would be the best way to implement it in react/react with redux?
So that dropdown option list would dynamically change according to options selected