The old element fades, disappears in the new

I am new to react and have tried reacting to animations . They work great when items are added or removed in a TransitionGroup. But if I replace one element with a similar one, it reacts, detects that the content of this element has changed and does not cause animation.

How can I fade out one element and disappear in a new place in one place? For example, login-div fades out, disappears in the div-panel.

+6
source share
1 answer

If your elements have different key attributes, TransitionGroup will disable one and mount the other.

You can read more about keys here: Composition versus inheritance .

+5
source

All Articles