需要加上key值,使每个dom不一样
报错:
{jigui.map((item, index) => { return <p>{item?.name}</p>; })}
不会报错:
{jigui.map((item, index) => { return <p key={index}>{item?.name}</p>; })}
标签:map,return,index,React,item,报错,key From: https://www.cnblogs.com/Simoon/p/16807352.html