Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It re-creates items even when they have unique identifiers? Is that a bug?


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: