React Native Picker Select: How to get no placeholder?

3.3k Views Asked by At

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' },
  ]}
/>
3

There are 3 best solutions below

0
On

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//
/>
0
On

placeholder={' '}

Inside string give space its 100% works for me

0
On
placeholder={{ }}

This work for me