If you take the animation out of the DOM-level code and put it in the CSS, doesn't that fix the issue? React then does not need to know about or control the animation and the browser just does what it does natively as things get added or removed from the DOM.