In my React select input, I want to iterate through my drivers array and for each driver generate the with the single driver as value. But when I console log the target value I have only a [object Object] and if I try to call, for example, driver.driverName I obtain "undefined". Why?
<label className="pt-label pt-inline">
Autista
<div className="pt-select">
<select onChange={this.changeDriver}>
<option>Scegli autista</option>
{this.props.drivers.map((driver) => {
return <option key={driver.key}
value={driver}>{driver.driverName} {driver.driverLastname}</option>
})}
</select>
</div>
</label>