Tengo este código React a cambio:
Buscaría y almacenaría el valor key en la opción, cuando la select está cambiando.
<select className={"select_1"} onChange={(event: React.ChangeEvent<HTMLSelectElement>) => { let startPaymentIn2 = { ...startPaymentIn }; var selectedIndex = event.target.options.selectedIndex; startPaymentIn2["pricingOptionId"] = event.target.options[ selectedIndex ].getAttribute("key"); setStartPaymentIn(startPaymentIn2); }} > {Object.entries(buyTicketData?.pricingOptions).map(([key, value]) => ( <option key={key}>{value.name}</option> ))} </select>; Por alguna razón getAttribute("key"); devuelve nulo, ¿por qué?
key es un accesorio React que no se pasa al DOM. No está en el elemento renderizado.