I've updated the link to react docs since the current link now gets redirected to a different topic.
Also, while reading the react docs, it seems clearer to say that react uses keys to track changes in collections, rather than to determine the order of rendering. Ultimately, the change sets do determine the order of rendering... but this seems clearer.
Keys help React identify which items have changed, are added, or are removed. Keys should be given to the elements inside the array to give the elements a stable identity
I've updated the link to react docs since the current link now gets redirected to a different topic.
Also, while reading the react docs, it seems clearer to say that react uses keys to track changes in collections, rather than to determine the order of rendering. Ultimately, the change sets do determine the order of rendering... but this seems clearer.
Per the react documentation on keys: