DEV Community

Discussion on: Animating React: GreenSock and React Hooks

Collapse
 
gilbertmizrahi profile image
GilbertMizrahi

Great article.
I have one question. Suppose you want to pass parameters dynamically to the tl timeline, how would you do that?

Collapse
 
coffeecraftcode profile image
Christina Gorton

Do you have an example? Typically if I am adding some kind of parameter I create a function for my TL and pass in parameters there. For example this is an animation I eventually used in a Vue app. If you go down to the startConfetti function you will see I used element and then passed in the elements I wanted to animate in the actually main timeline.
codepen.io/cgorton/pen/81813f8b48b...

Is that the kind of thing you are asking?