New here (also new with gsap/react); I have made a side bar that slides out from the right side,
I got the slide in animation to work but can't use .reverse() to reverse that animation.
It immediately resets back to xPercent: 100 , instead of animating.
Anyone here able to give me any pointers on how I should proceed?
Cant get .reverse() to reverse the animation in React(NextJS)
in GSAP
Posted
Hi there,
New here (also new with gsap/react); I have made a side bar that slides out from the right side,
I got the slide in animation to work but can't use .reverse() to reverse that animation.
It immediately resets back to xPercent: 100 , instead of animating.
Anyone here able to give me any pointers on how I should proceed?
Small code snippet:
(Dont mind the styling it's just a quick demo
)
CodeSandbox link: https://codesandbox.io/s/sidebar-y45kf1