Segment extends React.Component {
render() {
const days = ["Day 1", "Day 2", "Day 3", "Day 4", "Day 5"];
return (
<div className="segment">
{
days.map((d, i) => {
<div>
<input type="radio" id={`day-${i + 1}`} name="day" value={`Tay ${i + 1}`} />
<label className="segment-button" htmlFor={`day-${i}`}>{d}</label>
</div>
})
}
</div>
);
}
}
you need to use return keyword with curly bracers
x => x + 1 and x => (x + 1) but x => { return x + 1; }
Обсуждают сегодня