class App extends Component {
render() {
const tweets = [
{ id: 1, stars: 13, text: 'Turns out "git reset --hard HEAD^" was a terrible idea.' },
{ id: 2, stars: 87, text: 'Tech conferences are too expensive.' },
{ id: 3, stars: 51, text: 'Clean code is subjective. Optimize for deletion.' },
{ id: 4, stars: 19, text: 'Maybe the real benefit of open source was the friendships we made along the way?' },
];
const stars = tweets.map(tweet => tweet.stars);
console.log(stars);
return (
<>
<ul>
{
tweets.map((tweet, index) => (
<li>{tweet.text}</li>
))
}
</ul>
</>
);
}
}
export default App;
I am new in React.js, gettig a warning like below. I am getting the errors like that: Warning: Each child in a list should have a unique "key" prop.