Hello!
I am a react dev, and always wanted those flashy animations I often see on various places on internet!
I joined the GSAP community because I found that this is the best animating lib, on the market hands down.
although there are few stuff that are not clear to me:
A ) GSAP uses actual DOM for animating while react uses virtual DOM. so the docs suggest to use Ref's but there is no detailed and up-to-date tutorial on how to do it the clean way.
this is the best article I could find: (which is Greensock's promoted link)
https://edidiongasikpo.com/using-gsap-scrolltrigger-plugin-in-react
- Why is there many useEffects in that tutorial? and not one?
- What will happen if an element gets re-rendered? will the animation break? will it restart? will it go with no-problem but looses the efficiency? What if an state change? I have no clue...
- What if I have nested components? should I put each tween in each component's own useEffect? or should I put all of them in the parent and single useEffect? Should I register the plugins in each component or in parent only?
- What is the issue with the useLayoutEffect? Can't I use it? no tutorial used it. (I have some components that if I use useEffect I will end up seeing super short flashy glitches, so I use useLayoutEffect)
B ) For mounting/unmounting, can't I just use the GSAP? Why the hell does the docs suggest react-transition-group ??? I hate that library, always full of bugs and glitches and inconsistencies.
These are the question I have for now! I will be really thankful for the people who reply,
Love y'all,
Alixsep