Jump to content
Search Community

ScrollTrigger with React-locomotive-scroll not working

Gonza Bordes test
Moderator Tag

Recommended Posts

Hello Everyone! sorry for my english. Ok , so im trying to use React-locomotive-scroll together with gsap Scrolltrigger. I set up my scrollerproxy component and inserted it into my app and averything seems fine (console is not showing any errors). But when i use scrolltrigger in to my Home page my animation target doesn t change. But when i resize my screen the animation starts. Did anyone came in to this problem before?

 

I left attached  will leave my APP, HOME and SCROLLERPROXY code pics to make it clear. Thanks and i hope someone can help me :)

 

 

 

scrollerProxy-min.png

home-min.png

app-min.png

Link to comment
Share on other sites

Hi @Gonza Bordes and welcome to the GreenSock forums!

 

Honestly I've never used Locomotive in any setup so I don't have a clear idea of how it actually works.

 

I'd recommend you to take a look at this thread as it seems that the user there was able to integrate it successfully:

If you keep having issues please remember to include a minimal demo. You can fork this example and include locomotive there in order to see what could be the problem:

https://stackblitz.com/edit/react-cxv92j?file=src%2FApp.js

 

Happy Tweening!

Link to comment
Share on other sites

 

Hello all,

 

I hate to be the party-pooper and if I am wrong with this, or out of line, I beg your pardon, but I just wanted to mention that using the approach in the thread, that @Rodrigo mentioned might not be the best idea, since it appears to be rather problematic for a couple of reasons mentioned in this other thread by the same user from a couple of days later.

 

Now again, I really don't want to call out anybody,  but I also wouldn't suggest their approach as a solution (at least for the time being), so I thought this was worth mentioning. Might be worth also making a note of that in the thread where the use of that hook is suggested?

 

  • Like 1
Link to comment
Share on other sites

Hey Paul,

 

No need to apologize for anything. Actually thanks for pointing out possible issues with the suggestion in my last post and the linking another thread  for such issues.

 

It definitely seems like a good idea moving forward to have a basic example of Locomotive with ScrollTrigger on React.

  • Like 1
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.
×
×
  • Create New...