ReactJS Tutorial - 28 - Refs

preview_player
Показать описание

📱 Follow Codevolution

Refs make it possible to access DOM nodes directly within React.
Рекомендации по теме
Комментарии
Автор

You're the best teacher.
Thank you for your great content and waiting for *NodeJs* Course.

iUmerFarooq
Автор

I will recommend your course to whoever wants to learn React!"! A lot of thank you!

lollilolli
Автор

Very articulate, I have never seen such profound elaboration . Thanks a lot for such valuable content .

pashish
Автор

Refs To Input element:
Ref - to make autofocus
Steps:
1. Create ref – using React.creatRef() and assign it class variable – reference variable
2. attach to input element using “ref” attribute
What above step does: makes the input element = ‘current’ property, in the class variable.
3. call focus() method on input element. – using the current property
Types/ways:
1. React.createRef - uses “current” property - above
2. callback Ref - without “current” - below
callback Ref:
Steps:
1. create a property with null
2. on function click, call setter of that property and assign the ‘element’
3. call focus method – directly from reference variable

vigneshgvs
Автор

Omg, I can literally pay any amount for such quality content. I hope you could do a series where you build a complete project using ReactJS + NodeJs.

anshulsinghla
Автор

I like your videos because you provide summary at the end.

allansarion
Автор

You are an amazing teacher, thank you so much!! 🙏

Hermioneswand
Автор

You're the best teacher.
Thank you for your great content

tuatkiep
Автор

best explanation of React Ref that I found

marcofriso
Автор

2:05 second step is to attach ref to input element in render method

prisinha
Автор

you are blessing to the all programmer

rajeevbhosle
Автор

0:05 Refs help to access DOM nodes directly

prisinha
Автор

2:32 third step is to call focus method on this input element

prisinha
Автор

functionality is working fine with adding the callback function outside of there any reason to add the callback function inside of constructor ?

vigneshtamizh
Автор

I looked up Vishwas and went into a Bollywood rabbit hole. Cheers

lightninginmyhands
Автор

Great job, please keep doing
Thank you very much 😊

MaheshKumar-qxdy
Автор

Using React.createRef

Create ref: Use React.createRef(), assign to variable in component.
Attach to input: Use ref property on input.
Call focus(): Access input via current of ref, call focus().
Using Callback Ref

Create property: Create property, initialize to null.
Assign callback: In input's ref, pass callback function.
Call focus(): In callback, save input to property, call focus() on it.

minthep
Автор

the tutorials are very interesting and the way of expiration looks like what the instructor is amazing, thank you a lot sir. please send the document that helps me as I am a beginner

beneasmare
Автор

We can use autoFocus property on the element right? Why do we need Refs?

jreema
Автор

Wow its amazing explanation and very valuable content!!! Thanks a lot

ינוןאלבז-כז