Can we add SVG icon in Picker.Item?

215 views Asked by At

I am trying to add SVG icons in <Picker.Item /> using react-native-picker/picker library but it doesn't show.

Here I am putting a piece of code:

(language, index) => {
  return(
    <Picker.Item
      label={ <EnglishFlag height={25} width={25} /> + language.name}
      value={language.value}
      key={index}
     />
  )
});

I want to mention that I want to use only svg icon not emoji. Is there any way to do in this form?

Thanks in advance

1

There are 1 answers

0
Madhav Nasit On

You can use flag emoji by copy from some website and paste it in string like below, <Picker.Item label=" France" value="fr" />