If the key is an index, reordering an item changes it. Hence, the component state can get mixed up and may use the old key for a different component instance. Without a unique key, React can't differentiate if the element was removed or just the content is changed.
If the key is an index, reordering an item changes it. Hence, the component state can get mixed up and may use the old key for a different component instance. Without a unique key, React can't differentiate if the element was removed or just the content is changed.