Video demonstrating my issue: https://i.imgur.com/L3laZLc.mp4
I have a simple app where you can add Cards to 2 different Rows. When a card is added to a row, I'm using react-transition-group
to trigger an "enter" animation.
However, I also have react-beautiful-dnd
installed to enable dragging Cards between the Rows, and also to re-order the Rows themselves. But when a Card is moved to a new Row, or when the Rows are re-ordered, some of the cards have their "enter" animation fire, which looks very weird and should not be happening.
When dragging, the unwanted animation will fire when
A Card is dragged to a different Row.
A Row is re-ordered and the 2 Rows have different numbers of Cards.
Oddly, the unwanted animations will not happen when
- A Card is dragged to a new position within its original Row.
- The Rows are re-ordered and the Rows have the same number of Cards.
I would like to know how I can have it so the react-transition-group
animations will not fire when the state
is modified by using react-beautiful-dnd
.
Sandbox of my issue (More information in comments in the App.js
file):