Jump to content
GreenSock

chinnmay

scrolltrigger PIN issue in react

Recommended Posts

 

Hello @chinnmay

 

That appears to be a problem with React's StrictMode and how it handles things from React 18.0 on.

 

You should definitely check out gsap.context(), which was added in GSAP 3.11 

 

There is a demo for use with React on the very bottom of that docs page

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

 

 

 

This is your example working with that.

 

https://codesandbox.io/s/nice-darwin-bp35ve

 

 

 

And if you want to read more about how and why the StrictMode in React 18 makes things problematic, check out this thread.
 

 

 


 

 

  • Like 3
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.
×