I have below render function in react class
class ShowDesc extends Component {
constructor(props) {
super(props);
this.dataset = [{
desc: 'This is desc',
}, {
desc: 'This is desc',
}, {
desc: 'This is desc',
}, {
desc: 'This is desc',
}];
}
render() {
return (
<div>
<ul>
{this.dataset.map(item => {
<Desc desc={item.desc} /> // I get below error on this line
})}
</ul>
</div>
);
}
}
I get below error in above line
Expected an assignment or function call and instead saw an expression no-unused-expressions
The error is does not give too much detail and I am not sure what exactly am I doing wrong in this code?