'React Native Picker Select: How to get no placeholder?
I've tried to do placeholder={{}} but then the first item label became the placeholder.
What can I do when I just want to literally have NO PLACEHOLDER at all?
<RNPickerSelect
placeholder={{}}
onValueChange={(value) => console.log(value)}
items={[
{ label: 'Football', value: 'football' },
{ label: 'Baseball', value: 'baseball' },
{ label: 'Hockey', value: 'hockey' },
]}
/>
Solution 1:[1]
Maybe you could try this, but there still have a blank select at the list, and I set the value to default that you could use it to distinguish.
<RNPickerSelect
onValueChange={value => console.log(value)}
items={[
{ label: "Football", value: "football" },
{ label: "Baseball", value: "baseball" },
{ label: "Hockey", value: "hockey" }
]}
placeholder={{ label: " ", value: "default" }} //here OwO//
/>
Solution 2:[2]
placeholder={{ }}
This work for me
Solution 3:[3]
placeholder={' '}
Inside string give space its 100% works for me
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | 高鵬翔 |
| Solution 2 | Mahesh Amte |
| Solution 3 | GUGAN RAJ |
