Рет қаралды 1,367
In this video, I'm gonna tell you why you should never use index as the key. in React Lists.
You may have heard about it already from other developers that it is not recommended to use the index (or indices) of the item in the array as the key prop when looping over an Array to render a list of items. But if you do it, you'll see that there is literally no issue in doing so. But then...why is it not recommended? Let me show you with an example of why it is bad to use indices as keys in a React app.
Code Repo:
github.com/code-with-ahsan/re...
✨FREE APIs to use for your passion projects ✨
codewithahsan.dev/rapidapi
⭐ Sign up for updates on my Full Stack Developer Course: codewithahsan.dev
⭐ New to code and none of this is making sense? Watch my '5+ KZfaq Coding Bootcamp' in which you will learn HTML, CSS, and JavaScript Fundamentals completely from scratch. It's at codewithahsan.dev/web-dev-boo... and it's 100% free.
⭐ If you would like to buy me a coffee, well thank you very much that is super cool! : buymeacoffee.com/codewithahsan
You can also find me on:
Twitter: / codewith_ahsan
Instagram: / codewithahsan
GitHub: github.com/ahsanayaz
Facebook: / codewithahsan