React Core & Hooks (407 Qs)•General
What is the impact of indexes as keys?
junior LevelMost AskedreactGeneral
Keys should be stable, predictable, and unique so that React can keep track of elements.
In the below code snippet each element's key will be based on ordering, rather than tied to the data that is being represented. This limits the optimization capabilities of React's reconciliation engine.