React Native - Use a keyExtractor with FlatList

前端 未结 8 1179
暖寄归人
暖寄归人 2021-02-01 14:05

I have been getting the:

\"VirtualizedList: missing keys for items, make sure to specify a key property on an item or provide a custom keyExtractor\"

8条回答
  •  -上瘾入骨i
    2021-02-01 14:47

    Actually, in my case, FlatList data prop value was not an array type (it was empty object) so when I add keyExtractor={(item, index) => item.key} it made an error.

    I hope it helps you.

提交回复
热议问题