Код: Выделить всё
const getAlimsModif = (picture) => {
let result = [];
for (const sample of picture.samples) {
result.push(
id={sample.mask_ref}
value={sample.image_ref}
onMouseEnter={(e) => { setHoveredAlim(e.target.id); setHoveredImg(sample.image_ref) }}
onMouseOut={(e) => { setHoveredAlim(null); setHoveredImg(null) }}>
{getFoodName(sample)}
{sample.mass.toFixed(1) + " g"}
dropdownModifAlimOpen ? setDropdownModifAlimOpen(null) : setDropdownModifAlimOpen(sample.aliment_id)}
isOpen={sample.aliment_id === dropdownModifAlimOpen}
onChange={(e) => updatePictureAlim(e, sample)} />
value={sample.image_ref} style={{ width: "25%", height: "100%", flexDirection: "row", display: "flex", justifyContent: "center", alignItems: "center", paddingRight: "1%" }}>
updateMassAlim(e, sample)} /> g
)
}
return result;
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... ng-the-dom
Мобильная версия