{buyTicketData?.pricingOptions && (
<select className={"select_1"}>
{Object.entries(buyTicketData?.pricingOptions).forEach(
([key, value]) => {
<option key={key}>{value.name}</option>;
}
)}
</select>
)}
I found here how I can loop in React return
, so, that not only the key
is available as with Object.keys()
, but value
also. I can see during debugging, that call jumps in the option
part, but in the rendered HTML no option appears, only an empty select
. Why?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries