The key prop is used by React to identify which items have changed, are added, or are removed. Unmounting the previous instance simply means that all state that had existed in the component is completely removed. This is another little known secret about React key prop.
Sort: