📜  WARN VirtualizedList:缺少项目的键,请确保在每个项目上指定键或 id 属性或提供自定义 keyExtractor. - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:28.905000             🧑  作者: Mango

代码示例1
Simply do this:

 {item.name}
  } 
  keyExtractor={(item, index) => index.toString()}
/>

reference:
https://facebook.github.io/react-native/docs/flatlist.html#keyextractor