Closed yiescc closed 1 year ago
Describe the bug 如果有两个空的变量渲染在一个地方就会报错same key
same key
To Reproduce
{[ { id: 0, icon: "", prefix1: "", suffix1: "" }, { id: 1, icon: "", suffix1: "", prefix1: "" } ].map((item) => { return ( <div key={item.id}> {item.id} <i style={{ backgroundImage: `url(${item.icon})` }} /> <span> {item.prefix1} {item.suffix1} </span> </div> ); })}
https://codesandbox.io/s/optimistic-microservice-cyeuo?file=/src/app.js
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
(please complete the following information)
Additional context Add any other context about the problem here.
Describe the bug 如果有两个空的变量渲染在一个地方就会报错
same key
To Reproduce
https://codesandbox.io/s/optimistic-microservice-cyeuo?file=/src/app.js
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
(please complete the following information)
Additional context Add any other context about the problem here.