Hello. I am working on a React.js project and essentially trying to recreate the codepen link I added (someone else's work). It's on a pretty long homepage at the very bottom above the footer. For whatever reason, not only are the start/end markers (for the pinned/selected section) way above where the element should be, causing an overlap, but a huge amount of white space was created between the selected section to be pinned and the section above it. So the "end" appears to be where the "start" marker should be and the start marker is about the height of the selected section (containerRef) above that.
I've tried ScrollTrigger.refresh() in my useEffect (for component did mount). But it still loads way above where it should be. Below is the ScrollTrigger I created. Apologies that I was unable to recreate the issue in CodePen. Any ideas as to what may be causing this behavior? I've watched so many tutorials and been through so many threads, but I have been unable to find a solution. My ScrollTrigger, of course, is also in a useEffect[]
ScrollTrigger.create({
trigger: containerRef.current,
pin: true,
start: 'top top',
end: '+=500',
scrub: 1,
markers: true,
});