I have the following ul in react: (I know that using index is not always the best idea. Just for simplicity)
(我有以下ul反应:(我知道使用索引并不总是最好的主意。只是为了简单起见))
<ul>
{project.topics.map((topic, i) =>
<li key={i}>{topic}</li>
)}
</ul>
which results in the following warning:
(这将导致以下警告:)
Warning: Each child in a list should have a unique "key" prop.
Check the render method of `CvPage`. See .... for more information.
in projectCard (at cv.js:22)
Why does react complain about the key property, despite it being there?
(为什么反应会抱怨关键资产,尽管它在那里?)
The HTML looks like this: (HTML看起来像这样:)
ask by Console translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…