Key & Ref Best Practices
Use stable keys, avoid index-as-key pitfalls, and work with callback refs.
Welcome
In this lesson you will learn how to use list keys correctly, why using array index as a key causes bugs, and how to work with callback refs and forwarded refs.
Why Keys Matter
React uses `key` props to track which items in a list changed, were added, or were removed between renders. A correct key lets React reuse existing DOM nodes; a wrong key causes unnecessary unmounts and remounts.