I'm using GSAP in my React app and I've been running into a ton of null target errors when switching back and forth rapidly between routes.
The problem is that my animation takes longer than swiping left / right on my Macbook to go back / forward so, by the time the next page has loaded, the old animation is still running and trying to tween a null target.
I can fix this easily by having a null check in the animation but I have alot of calls to TweenMax so I was wondering if there was an easier way to either 1. fail silently 2. have middleware for null checks
I'm not quite sure how you have things set up, but there's a TweenMax.killTweensOf() that you could use to destroy stuff in your cleanup code when exiting a route. Or shove your tweens into a TimelineLite that you kill(). Or use variables to track your tweens and kill() them when you need to. Lots of options.
If you have GSAP-specific questions, keep in mind that there's a dedicated community at https://greensock.com/forums/
Happy tweening!