3 ms·
It re-creates items even when they have unique identifiers? Is that a bug?
by myhf 12y ago
It re-creates items even when they have unique identifiers? Is that a bug?
- funkiee 12y agoIt's as intended. If the ID in a list of 100 changes, and that ID is the key, React is going to assume the tree is different during reconciliation. If you were to use an index, like 0, on pagination the key is still 0 and as such the DOM nodes will be reused. http://facebook.github.io/react/docs/reconciliation.html http://facebook.github.io/react/docs/reconciliation.html See #2 in the Trade-offs section.