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\"
this will work sure. First generate random number.
let generateRandomNum = () => Math.floor(Math.random() * 1001);
then call where you need generate random number. like :-
{ id: generateRandomNum().toString(), value: 'your value'}
//below i share small part of my code for better understand
const addGoalHandler = enteredInputGoal => {
console.log('random nub', generateRandomNum());
setCourseGoals(courrentGoals => [...courrentGoals, { id: generateRandomNum().toString(), value: enteredInputGoal }]);
};
and finally use in FlatList
item.id} data={courseGoals} renderItem={itemData =>itemData.item.value } />