react-native-dropdown-picker
react-native-dropdown-picker copied to clipboard
Filtering the selected item from the dropdown
Hello, I have an array of data which includes three items, I want to make whenever one is selected, it gets excluded from the dropdown items, so that it wouldn't look like a duplicate option. When I try
const [selectedLang, setSelectedLang] = useState(i18n.language);
items.filter(item => item.value !== i18n.language);
it does filter the items, but the selection does not work since the items are filtered and the selected Item does not exist anymore on the array anymore (that's what I guess is going on).
how can I implement this ?
Thank you,