How to add search bar to Picker React Native

Viewed 717

I am really new to React Native and try to add a search bar to Picker , here is the package I used import {Picker} from '@react-native-picker/picker'. However I could not find any resource about this issue. Also I tried to use react-native-dropdown-picker package but it gives lots of error and cannot even build the project. Here is the my picker on code, and it works well. Can you help me to find a way to add search bar to this Picker?

        <Picker
        selectedValue={selectedValueVarlikTur}
        style={{ height: 50, width: 300,alignSelf:'center'}}
        itemStyle={{height: 44, fontSize:16}}
        onValueChange={(newValue) => setSelectedValuVarlikTur(newValue)}>

        { varlik_tur_arr.map((value,index) => {
             return <Picker.Item label={value} value={value} key={index} />}) }   

        </Picker>
1 Answers

@iozy, Place the search bar UI just before the .map function. It will work for sure.

Related