React keys
Should I just trust React that the keys I've set are unique if it doesn't complain? I can't see them anywhere in devtools, and was just a bit suspicious that it had quietly allowed a mistake of mine to slip through. Obviously I can add UUID or w/e, but was just interested in whether it's visible at all?
8 Replies
Did you try the react devtools browser plugin?
I'm not sure if it shows it there either but worth a try if you don't have it installed yet
it does show them in react devtools extension.
also you can get error in console saying multiple elements have identical keys if you use react strict mode
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Using index for keys is generally not recommended
Lists and Keys – React
A JavaScript library for building user interfaces
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Cool!