Each child in a list should have a unique "key" prop

Each child in a list should have a unique "key" prop

在进行循环组件时需要指定key,否则会引起混乱,如下需要指定key

  sysConfig?.topmenu.forEach((element:any)=>{

    topRightMenus.push(

      <span key={element.slname}>

        <Link to={{'pathname':element.slname}} target={element.linkTarget} title={element.cdtitle}>{element.mename}</Link>

      </span> 

    )

  })


爆款云服务器s6 2核4G 低至0.46/天,具体规则查看活动详情Blog Img