ListItems has declared
in state that the following code is called in successfully getting the interface data success
that.state.ListItems = that.state.dataList.map(item => (
<div className="list" key={item.goodsID}>
<img src={item.goodsListImg} alt="" />
<div className="detail">
<div className="title">{item.goodsName}</div>
<div className="price">
<span>{item.price}</span>
</div>
</div>
</div>
));
console.log(that.state.ListItems);//
render
render() {
return (
<div className="hot">
<div id="mescroll" className="mescroll">
{this.state.ListItems}
</div>
</div>
);
}
I wonder if my way of dynamic rendering is correct