Hi, Is that possible to change target of an existing tween (without recreating it like here)? Or clone the tween or timeline with the current var-s and the new targets? It's is important to use the same tween because it can contain some randomly generated var-s which aren't stored anywhere else. I'm thinking on something like:
var animation = TweenMax.to(nodeFirst, 1, {x: Math.random()})
function duringTheAnimation() {
time = animation.time()
animation.invalidate()
magicallyReplaceTargets(animation, nodeFirst, nodeSecond)
animation.restart()
animation.time(time)
}
I'm experimenting with a tool to use React and GSAP together. The goal is to let React to rerender any time it wants during the animations while GSAP can directly animate the DOM nodes (not messing with the React component state). It's going well so far, but it would be great to solve the case when the component remount the targeted element.