Capítulo 393 de 411
GSAP is a framework-agnostic animation library, that means that you can write the same GSAP code in React, Vue, Angular or whichever framework you chose, the core principles won't change.
let tween;
// create your animation when the component mounts
onMounted(() => {
tween = gsap.to(el, { rotation: 360, repeat: -1 });
});
onUnmounted(() => {
tween.revert(); // <- revert your animation when it unmounts
});