How to create an array of React refs

How to create an array of React refs

Ihatetomatoes

4 года назад

24,624 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Afonso Carvalho
Afonso Carvalho - 21.09.2023 16:23

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

Ответить
Alex T
Alex T - 28.06.2023 21:41

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

Ответить
Alexander Diakonov
Alexander Diakonov - 14.02.2023 01:52

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

Ответить
Jo Anisky
Jo Anisky - 03.02.2023 23:46

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

Ответить
William Chorski
William Chorski - 13.12.2022 00:56

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

revealRefs.current[0].myChildFunctionOne()

but with no luck

Ответить
Michael Edaño
Michael Edaño - 18.10.2022 13:21

Thank you for this. It's really helpful.

Ответить
Slim Moumen
Slim Moumen - 24.08.2022 15:30

it's the most power tutorial

Ответить
Filipe Valente Gomes
Filipe Valente Gomes - 12.08.2022 00:17

Do you have a full GSAP course with react?

Ответить
Alabhya Jindal
Alabhya Jindal - 11.08.2022 18:49

Thanks!! Great explanation, super helpful

Ответить
Fatemeh Karimi
Fatemeh Karimi - 08.08.2022 22:40

great job! thanks a lot

Ответить
Essential Christmas
Essential Christmas - 09.06.2022 14:21

You're a lifesaver, thanks a million !

Ответить
Максим Нырков
Максим Нырков - 24.05.2022 13:47

Спасибо!

Ответить
carlos mata
carlos mata - 13.05.2022 22:43

Thanks!!!

Ответить
Kushal Davda
Kushal Davda - 18.02.2022 10:17

Thankyou! you made it simple and short.

Ответить
Batuhan KIR
Batuhan KIR - 18.02.2022 00:22

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

Ответить
Vimlesh Kumar
Vimlesh Kumar - 04.02.2022 10:13

super method!

Ответить
MINJU KANG
MINJU KANG - 01.01.2022 14:48

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

Ответить
Jorge Acosta
Jorge Acosta - 17.12.2021 18:12

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

Ответить
joephus24
joephus24 - 13.10.2021 14:00

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!

Ответить
Joseluips Cortes
Joseluips Cortes - 10.08.2021 23:44

NICE EXAMPLE, THANKS

Ответить
梁永霖
梁永霖 - 17.05.2021 05:04

It helps a lot! thank you so much!

Ответить
Leandro da Silva Saraiva
Leandro da Silva Saraiva - 12.02.2021 18:28

My array ref on render is empty

Ответить
Raphael Americano
Raphael Americano - 09.02.2021 19:20

Awesome! Help to fix my bug

Ответить
John Namtae
John Namtae - 21.01.2021 03:24

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

Ответить
Malte Svensén
Malte Svensén - 19.12.2020 15:12

Thanks, very helpful!

Ответить
Aguirregabiria Thomas
Aguirregabiria Thomas - 26.11.2020 16:05

Thanks a lot !

Ответить
Adithya Sundar
Adithya Sundar - 19.10.2020 08:46

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

Ответить
Léo De Spiegeleer
Léo De Spiegeleer - 16.09.2020 00:57

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

Ответить
JohnnyBlue83
JohnnyBlue83 - 10.07.2020 18:17

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.

Ответить
JoeBoo
JoeBoo - 10.07.2020 15:56

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

Ответить