Something that helped me in Reactjs was to kill all the ScrollTriggers on a page when it dismounts.
In the useEffect I have to create the ScrollTriggers I am doing this:
useEffect(() => {
...
...
return () => {
// We kill all scroll triggers so the next pages can recreate them.
const triggers = ScrollTrigger.getAll();
if (triggers) {
triggers.forEach((trigger) => {
trigger.kill();
})
}
};
}, []);
Hope this helps someone.