Keys and Reconciliation

⭐ Interview Importance: MEDIUM
⏱️ Revision Time: 2 min

Keys and Reconciliation

Documentation for Keys and Reconciliation coming soon.

Interview Questions

Q: Exactly how does React use key props during reconciliation?
A: When React compares an old list of elements to a new list, it uses the keys to match up the children. If an item is added, moved, or removed, the stable key tells React exactly which node corresponds to which data, allowing it to efficiently re-order the existing DOM nodes instead of wastefully destroying and recreating the entire DOM list.