小编czl*_*488的帖子

React js,在数组上映射时有关键的错误

我有一个数组。我正在使用地图来显示它React。React 抛出有关键的错误,我不知道为什么。有什么想法为什么会React抛出这个错误吗?

{
    this.state.buttons.map((button, index) => {
       return (
       <>
         {index % 4 === 0 && (
           <div key={`break-${index}`} className="w-100" />
         )}
         <Button key={index} char={button} click={this.pushString} />
       </>
     )
})}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

reactjs

2
推荐指数
1
解决办法
2938
查看次数

标签 统计

reactjs ×1