Good question! One major thing to avoid alongside index is random keys such as uuid. A proper key should be a unique identifier from the data object you are passing. Check out the following example:
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.
Good question! One major thing to avoid alongside index is random keys such as uuid. A proper key should be a unique identifier from the data object you are passing. Check out the following example:
Thank you for this
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.
Instead of
uuid
, you could use this function that just returns an incrementing integer (guaranteed to be unique and no external dependencies):