Hacker News new | ask | show | jobs
by myhf 4144 days ago
It re-creates items even when they have unique identifiers? Is that a bug?
1 comments

It'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 See #2 in the Trade-offs section.