DEV Community

Discussion on: Bad ReactJs practices to avoid

Collapse
 
jamesthomson profile image
James Thomson

One major thing to avoid alongside index is random keys such as uuid
All you need to avoid is setting the key an each render. It's perfectly fine to use a uuid if you define it as part of the object being consumed and that uuid persists.

Thread Thread
 
jurajuki profile image
Juraj Pavlović

Indeed, if the uuid is a part of the object, then of course it is fine to use it. That way it is not a random key like I've mentioned.