Significance of keys in rendering lists in React
A demonstration to show that when array index is used as the key attribute while rendering lists in React, it can cause bugs and performance degradation. — Why is using array indices as keys while rendering a list an anti-pattern in React? React uses keys to identify/differentiate between items. Array indices do not prove to be stable keys and using them while looping through items while rendering, can cause bugs and performance issues, because of the way React is designed. This is evident from the examples discussed below.