How to trigger RNPickerSelect' s onValueChange when there is only one item and no placeholder?

1.1k Views Asked by At

I am using React Native Picker Select and I don't know if it's intended to show only one item in Picker but, let's say I have only one item in the items array and no placeholder. How can I trigger onValueChange since there is only one item and no change at all.

In IOS it's easy, I can do onClose or onDonePress to get selected value in the picker even if there is only one item, but; in android I couldn't find a way to achieve that. Don't hesitate to share code snippet, documents, articles etc.

Thanks in advance.

 const expendableItems = [{label: 'JustONeItem', value: item}];

 <RNPickerSelect
        onValueChange={onValueChange}
        onClose={onClose}
        placeholder={placeholder}
        items={expendableItems}
        Icon={() => null}
  />
0

There are 0 best solutions below