How to create an array of React refs

preview_player
Показать описание
Learn how to target multiple elements using React refs.

Related Tutorial

--- Online Courses ---

Learn React

Premium GreenSock Tutorials

Premium Online Courses for front end developers and designers.

Resources (Affiliate Link)
Signup to GreenSock through this link to support the channel.
Рекомендации по теме
Комментарии
Автор

Im a beginner and it helped me to animate several elements simultaneously respecting the logic of React. Thank you so munch from France !

joanisky
Автор

Your explanation is so much better than the one in the documentation. Thank you for this great video!

afonsocarvalho
Автор

Thank you so much for the vid! Had to remove the ref.current = [] part since it was reassigning current on every render, but this is so super helpful, have been trying to recreate boostrap dropdown and this is exactly what's needed to get those pesky offsets for each list item. Cheers!

joephus
Автор

Damn ... Dude, thanks man, I've being looking for this method for a bit longer then I supposed. Bless you!

Keep_quiet_
Автор

Thanks for the video, I was able to implement a functionality to scroll to individaul section on the screen using this

minjukang
Автор

This is exactly what I was looking for! thank you very much!

jorged
Автор

Thankyou! you made it simple and short.

kushaldavda
Автор

Thank you for this. It's really helpful.

michaeledano
Автор

Thanks!! Great explanation, super helpful

alabhyajindal
Автор

You're a lifesaver, thanks a million !

christmascatalogue
Автор

Nice! I was juuust looking how to make arrays of refs while implementing gsap scrolltriggers, thank you! °D°

rougemage
Автор

Are you kidding me? I was trying this for the past week and could not make it work. I'm using FullpageJS and wanted to have same animation on every section for my elements but react was always throwing me some kind of error. In the end I was using FullpageJS function when a section is loaded but this is what I wanted at the begging. You are my hero.

Johnny_Blue
Автор

Do you have a full GSAP course with react?

filipevalentegomes
Автор

Is this still the way to do this? Also why do you have to set the initial state to an array if it's actually the .current property that points to the array of items? Appreciate the video though, great guide!

nickwoodward
Автор

trying to figure out how to do this for hours. Didn't realize you could just throw a callback into ref prop

alext
Автор

Hey ! That was some helpful tutorial to design a whole section with scroll. but if you can let me know how to target the h1, title tags seprately in the section, My case is the background color remains static the image and the title tag changes as we scroll, it changes horizontally, if we scroll
Thanks

adithyasundar
Автор

What is the main purpose of using this technique? Thanks for the vid by the way!:D

JoeBoo
Автор

i hate tomatoes too but pretend to like them when i eat burgers because of spongebob

johnnamtae
Автор

i wanna make a basic list: it will take parameter from an array like list=["name", "surname"]. i wanna put a "-" sign front them they will look like -name -surname when i hover them how can animate them. it is very easy with vanilla js but icadt do it with react. can u help me please

batuhankir
Автор

how would I trigger a child function from the parent using the `useImperativeHandle()` hook?

Now that the ref is an Array, i assumed it would be something like



but with no luck

wchorski
visit shbcf.ru