Closed sojimon closed 6 years ago
onSelect takes tow args as index
and rowData
.
your code should like this:
onSelect={(idx, data)=>{this.onTagSelect(idx, data)}}
onTagSelect(idx, data){ console.log("======== on tag selected ===========") console.log(idx, data) }
thanks It worked
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 .