I have added the dropdown field and I have to show the value in dropdown which I send but in this ionselect it takes only one value on the drop down.
const intila={
primary:[""]
}
const[primarySkill,setPrimary]=useState(intila);
const handleChange=(event:any)=>{
primarySkill.primary=event.target.value;
setPrimary(primarySkill);}
const[isSuccess,setSuccess]=useState(false);
const handleSubmit=(event:any)=>{
dispatch(postPrimary())
}
if(customerData.primary.length>0&&!customerData.isLoading&&!isSuccess){
for(var i=0;i<customerData.primary.length;i++){
var primary=customerData.primary[i];
primarySkill.primary.push(primary);
setPrimary(primarySkill); }
setSuccess(true);
console.log(primarySkill);
}
return (
<div>
<IonSelect className="ion-padding" multiple={true} onIonChange={handleChange} value={primarySkill.primary}>
{itemCustomers}
</IonSelect>
<IonButton onClick={handleSubmit}/>
</div>)
The postPrimary have ["Customer 1","Customer 2"]
itemCustomer have [Customer 1,Customer 2,Customer 3,Customer 4,Customer 5[][1]
Here the image view for UI:[1]: https://i.stack.imgur.com/RdmYz.png