Jump to content
GreenSock

Hernanbp

Gsap and react

Recommended Posts

So I'm new to gsap just started last night , and I did an animation and it works great when I run the server, but when I deploy on vercel it doesnt work anymore, any idea why this could be happening? , It works partially but not the same as in development, the stagger doesn't work properly and sometimes things just pop in the screen without animation.

 

I'm using NextJs 

Link to comment
Share on other sites

Welcome to the forums @Hernanbp

 

It's very hard to answer a question like this without a minimal demo. You can use CodeSandbox if you need to use next. Thanks!

Link to comment
Share on other sites

3 hours ago, OSUblake said:

Welcome to the forums @Hernanbp

 

It's very hard to answer a question like this without a minimal demo. You can use CodeSandbox if you need to use next. Thanks!

https://codesandbox.io/s/friendly-brahmagupta-kek36e?file=/src/App.js

this is what happens, the stagger doesn't work 

EDIT: I found the problem , I should have used the fromTo method. 

Link to comment
Share on other sites

It runs fine on CodeSandbox for me. Am I missing something?

 

If you're using React 18, maybe the issue is related to this. If not handled properly, your from animations might end up creating a from logic issue

 

 

I would also make sure that your effect has a dependency array and you kill of any animations you created in it. See the Cleaning Up part of our React Guide for more information about that.
 

 

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.
×