I'm animating a button and want to revert the tween once it is animated, but it does not work for me. The following function triggers on btnRef click in a React component.
function animateBtn(event) {
const btnTween = gsap.to(btnRef.current, {
duration: 0.2,
scale: 1.1,
yoyo: true,
});
btnTween.revert();
}