For any future readers, I ran into a very similar problem as Adam and was able to solve it with ScrollTrigger’s getAll() and kill() functions. Added to Barba’s afterEnter hook.
My ‘cleanGSAP’ function looked like this:
const cleanGSAP = () => {
let existingScrollTriggers = ScrollTrigger.getAll();
for (let index = 0; index < existingScrollTriggers.length; index++) {
const singleTrigger = existingScrollTriggers[index];
singleTrigger.kill(false);
}
ScrollTrigger.refresh();
window.dispatchEvent(new Event("resize"));
};