The example for transition group to animate in/out elements is with an array. I haven't had time to dig into the code but are we not able to use a ternary?
<TransitionGroup>
{ isFirstItemVisible ? (
<CSSTransition>
...
</CSSTransition>
) : (
<CSSTransition>
...
</CSSTransition>
)}
</TransitionGroup