Selecting the placeholder item causes a crash/duplicate placeholder items
Describe the bug
The app crashes if you select the placeholder item after selecting another item.
This occurs regardless of whether a placeholder is provided.
Adding an item object with value: null results in duplicate placeholder items appearing in the dropdown.
To Reproduce
Crash
- Select a non-placeholder item
- Select the placeholder item
- See error:
TypeError: TypeError: Cannot read property 'label' of undefined.
- Add an item object with a value of
nullto theitemsarray.
Expected behaviour
The placeholder item should just be selected. There should only be one placeholder item.
Screenshots
See below.
Smartphone (please complete the following information):
- Device: Samsung S6
- OS: Android 7.0
- react-native-picker-select version: 6.0.0
- react-native version: 0.55
- react version: 16.3.1
Reproduction and/or code sample
Crash
const items = [
{
label: 'Packed By Owner',
value: 'packed_owner'
}
]
<RNPickerSelect
items={items}
onValueChange={onChange}
value={value}
/>
Duplicate placeholders
const items = [
{
label: 'Select items...',
value: null
},
{
label: 'Packed By Owner',
value: 'packed_owner'
}
]

So you’re passing a placeholder in to the items array? Any reason you’re not using the placeholder prop?
If I use the placeholder prop, and select a non-placeholder item, then the placeholder item, I trigger an exception as described above.
Can you produce a reproduction on snack.expo.io?
@ylac
Can't repro, closing thanks.
I faced with the same problem, I downgraded react native version to 0.63.0, it resolved the problem