Jump to content
Search Community

Help getting a ScrollTrigger animation to work in React

evan.oneil test
Moderator Tag

Recommended Posts

I am still at the early stages of learning React, but I was wondering if anyone had resources or suggestions on how to get this to work in React. I've picked up that using

gsap.registerPlugin(ScrollTrigger); 

is a neccesary first step, but beyond that I'm struggling to find a way to port this over to React. I would greatly appreciate any help, thank you!

See the Pen gOmZYqL by evanoneil (@evanoneil) on CodePen

Link to comment
Share on other sites

Hi Evan!

 

Love your avatar. Best browser ever!

 

Your code probably isn't going to port over to React that well, but that animation is definitely doable. For get started with React and ScrollTrigger, I would recommend checking out this article first, and then if have any more questions, please hesitate to ask.

 

If you need to make a React demo,  you can use codesandbox.

 

Link to comment
Share on other sites

Thanks for the quick reply! I have read through that article a few times and been experimenting, I'm struggling to know where to start with getting the pin function to work. I tried to modify the example from that article with something basic of getting the Greensock logo to pin to the second slide, but no luck so far. Here's the codesandbox of this initial effort.

 

Do you have any suggestions of resources I could look into for using the pin function in react or thoughts on how I can get it working?

 

Thanks!

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