How do keys in React lists affect component unmounting?
When the key of a component in a list changes, React treats it as a different component. The old component with the previous key unmounts completely (triggering unmounting lifecycle methods), and a new component with the new key mounts. This behavior can be used strategically to force a complete reset of a component's state.