I'm building a UI where there is a list of items. When the user adds an item, it will send an API request to create a new item, but it will also add the item to the list with a temporary ID. Once the API comes back, it will replace the ID of the item with the actual ID from the backend. The problem is that when I change the key of the item in the list, react-transition-group will treat it as a deletion/addition and trigger an animation.
Here's my question: How can I tell react-transition-group that the new ID belongs to the old item, so it doesn't trigger an update?