React is not inserted into the tag after traversal.

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

Apr.02,2021

state as a dom tag, the only function that changes in react is that this.setState, can render


completely wrong. Please read the document to learn, do not invent by yourself


 <div className="hot">
    <div id="mescroll" className="mescroll">
      {this.state.ListItems ? this.creatDom(this.state.ListItems):null}
    </div>
  </div>

creatDom(data){
    return (
      data.map((item) => {
        return (
            <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>
        )
      })
    )
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b9fed9-43a4f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b9fed9-43a4f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?