I have a list of accounts with a load of properties on each account. I need to send a cut down version, with an array of only two fields, to a method. I have to pass a property called options to my SelectInput component, which has a list of ids and values, which land up rendereing a drop down.
<SelectInput
options={
this.value.allAccountsList
.map((item, index) => {
new {
id: item.Id,
value: item.name
}
})
}/>
But am getting:
Expected an assignment or function call and instead saw an expression
Is map the right thing to use here, and if so, what am I doing wrong?