react-native-select-picker
react-native-select-picker copied to clipboard
Issue for value equal to 0
I don't know if this is some implementation detail but when having a <SelectPicker>
with default value selected
equal to zero, the corresponding item is not automatically selected. This is not happening for other values.
<SelectPicker
selected={0}
>
<SelectPicker.Item label="option #1" value={0} /> // It is not being selected automatically
<SelectPicker.Item label="option #2" value={1} />
<SelectPicker.Item label="option #3" value={2} />
</SelectPicker>
Expected behavior
When it is set to zero, it should select the corresponding item
Notes
My solution for now is to use selected
with a default value being a string and for some reason that works.