react-native-dropdown-picker icon indicating copy to clipboard operation
react-native-dropdown-picker copied to clipboard

Update icon after item is selected

Open danielnmai opened this issue 3 years ago • 0 comments

I'm just wondering if it's possible to update the icon to a "checked" state after an item is checked (not the TickIcon). Something like this: image

I tried to manipulate the entire item list from setItems() with onSelectItem() but it does not work.

  const onSelectItem = item => {
    const selectedJobTypes = JOB_TYPES.map(type => ({
      label: type.label,
      value: type.value,
      icon: value.includes(type.value) ? <CheckedBox /> : <UncheckedBox />,
    }));
    setItems(selectedJobTypes);
  };

danielnmai avatar Apr 10 '23 21:04 danielnmai