Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Ben H.

Members
  • Posts

    1
  • Joined

  • Last visited

Ben H.'s Achievements

  1. Hello, I am having issues integrating GSAP ScrollTrigger with React.js. I want to have two different layouts for "desktop" and "mobile", defined by a breakpoint width of 1300px wide. I am conditionally rendering each layout based on an isMobile state, which I'm getting from the react-responsive library. Because of this, I don't think that the ScrollTrigger.matchMedia function is picking up on the new layout when you pass the 1300px threshold when resizing the window. It seems to work fine if you refresh the window completely, but if you resize your window to the breakpoint, the ScrollTrigger does not pick up the changes. Is there something I'm missing that would allow me to pick up on this conditional rendering? Or should I be rendering the layouts a different way? REPL.it can be found here Thank you!
×