Animations with ReactTransitionGroup
Chang Wang
797
Well, I managed to find a way to make it work using Promises. You basically wrap your TimelineLite.staggerFrom` call in a promise. When the promise is resolved, you call TimelineLite.eventCallback("onComplete", callback)`.
So as you see, I do pass the callback from the componentWillEnter` and compononentWillLeave` hooks, but instead of passing it straight to the staggerFrom` method as last argument, I pass it to the eventCallback` method as soon as the promise resolves, which means, as soon as the animation is done.