Skip to content

How to get the selected item from the dropdown in the "onSelect" function? #143

@sojimon

Description

@sojimon

I am new to react native.I used the react-native-modal-dropdown for a dropdown.I need to get the selected option in the "onSelect " function.I tried.And the code is given below.

<ModalDropdown defaultValue='(Select)' options={['react', 'react-native']} style={{borderWidth:1,borderColor:'grey',width:'100%',height:30,borderRadius:5,marginTop:5,height:25,paddingLeft:5}} dropdownStyle={{width:'95%'}} onSelect={(e)=>{this.onTagSelect(e)}}>

And my function is
onTagSelect(e){ console.log("======== on tag selected ===========") console.log(e) }

And the '0' and '1' get consoled .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions