You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cases where the array is sorted or an element is added to the beginning of the array, the index will be changed even though the element representing that index may be the same. This results in unnecessary renders.
In React, to prevent unnecessary renders is depend on shouldComponetUpdate or memo.
key is not really about performance, it's more about identity (which in turn leads to better performance). randomly assigned and changing values are not identity.
When the array is sorted or an element is added to the beginning of the array and the element has it's own state, the element will render unexpectedly. I think that's the point.
The text was updated successfully, but these errors were encountered:
In React, to prevent unnecessary renders is depend on
shouldComponetUpdate
ormemo
.In this issue facebook/react#1342 (comment),
When the array is sorted or an element is added to the beginning of the array and the element has it's own state, the element will render unexpectedly. I think that's the point.
The text was updated successfully, but these errors were encountered: