Jump to content
GreenSock

Manvel

How to connect scrolltrigger to react?

Moderator Tag

Recommended Posts

image.png.2a8f357df82ec623b9cbeff545706673.png

what is highlighted works, but what is written at the top does not work

 

 

image.png.25527d76fae8c7590a48aca5e2f4b77f.png

imports

 

image.png.a9220919fec74192e137bc09ae8d5fbc.png

image.png

Link to comment
Share on other sites

Hi,

 

Is really hard for us to find issues without a minimal demo. You can fork our React Starter template directly on this link:

https://stackblitz.com/edit/react-cxv92j

 

Or you can find our most popular templates in Stackblitz Creative templates:

https://stackblitz.com/?starters=creative

 

Based on the images you shared the only issue I can see is that you're not using GSAP Context. When it comes to using GSAP in a React environment Context is your best friend!

https://greensock.com/docs/v3/GSAP/gsap.context()

 

Also I recommend you to check the articles in this section of our website:

 

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

It looks like you aren't importing ScrollTrigger or registering it.
 

import ScrollTrigger from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×