Whats up everybody? Thanks for watching! If you enjoyed the video, please be sure to drop a like it really helps. Also, if you have not already done so, be sure to subscribe to the channel so you never miss an upload. You can subscribe here: kzbin.info
@aruchgupta2 жыл бұрын
You're the coolest React mentor out there! Thank You. And so underrated!
@PawanKolhe3 жыл бұрын
The best explanation of Refs I could find on KZbin. Thanks.
@SlimAndCherryTravel3 жыл бұрын
I'm not sure what it is about these videos, but you are providing the kind of learning I've been looking for with React. I can look at tutorials all day and nothing sinks in, almost like the teacher is trying to save me from the difficult parts, but I walk away never actually knowing how the hell anything actually works. Far out man, thank you. Well done. I looks forward to more of these. In the meantime, I've got a bit of a back-catalogue of yours that I need to work through. :-)
@ikibkilam83834 жыл бұрын
I never really understood useRef, though I have used it a few times. This is the best explanation of what it does. Thank you very much for this awesome explanation!
@CodingWithChaim4 жыл бұрын
Thank you!!
@ahmed-osama2022 Жыл бұрын
Thanks a lot for explaining this concept very well, I loved you way you teach
@smellycyborg31333 жыл бұрын
brilliant. you're explaining everything in such good detail. and because i've been coding for a year i understand it. i'm switchign for game development to dev
@Moon-nk7gv Жыл бұрын
I am so lucky to find your videos! I don't think i am smart But u really make me understand almost everything you said! You are such an amazing teacher! Keep it up the good work. You have no idea potentially how many lives You are saving ❤
@tomasgilamoedo83013 жыл бұрын
Excellent explanation, solid and detailed! really appreciated
@tejasnikam32874 жыл бұрын
Keep it up bro really helpful !!! Headsup from India !!!!
@pritulkhan13954 жыл бұрын
You got a lot of potential with this channel, just wanna say keep it up -- you have earned a sub. Cheers from Bangladesh
@CodingWithChaim4 жыл бұрын
Thank you! I appreciate that
@haciendadad Жыл бұрын
Very helpful! Thanks!
@naveenkalburgis4 жыл бұрын
Good tutorial. Instead of using useRef for focus.. you could simply use autofocus attribute on input text JSX element for this first example.
@girugaymesh2 жыл бұрын
I'm still kind of new to react and I only get to work on my project in my free time, so I need all the help I can get: I have a problem with useRef() that is driving me insane. I slapped a click listener onto a bunch of GenericComponent swhich attaches a "wraparound" Component to the click component. What I want to happen is: before click: after click: In my useEffect() hook, I try to access the currently clicked Wraparound- and GenericComponent, but it does not seem to catch up. Aftter my first click, the ref will be undefined. After my second click, the console output will be the first clicked element. I feel like I am not getting a crucial part about how useEffect() works here.. Any help is greatly apprecianted.
@georgevinueza72493 жыл бұрын
Thanks for the quality content Chaim!
@emekaokonkwo626 Жыл бұрын
Thanks for this video by the way really needed, but so when you had "const time = useRef(Date.now())" and left the "ref={inputRef}" in the "input" tag, it still worked???
@CandyMoney10004 жыл бұрын
Great video man. Thank you!
@CodingWithChaim4 жыл бұрын
You are most welcome
@mathearts97393 жыл бұрын
awesome explanation god bless you
@mr.RAND55844 жыл бұрын
I want to desttructure html on that useref coz i want to use the get element by tag name. I have multple 50s input type text dynamically created by map function.
@r-i-ch4 жыл бұрын
Why not for the focus?
@CodingWithChaim4 жыл бұрын
Yea that absolutely can work, but the idea is that sometimes you want to set focus to an input programmatically based on some conditions. Also, the idea of the example is more about showing that in react you need refs when you want interact with the actual dom.
@iliketocode69864 жыл бұрын
does this cover ref forwarding?
@CodingWithChaim4 жыл бұрын
No I didn’t include that in the video
@Gandolfof4 жыл бұрын
Thanks you! Awesome video explaining refs. But why don't you simply use this: useEffect(() => { const time = Date.now(); setInterval(() => { if (moment.diff(time, "minutes") > 1) { alert("you have ...") } }, 1000 * 60); }, []) Isn't it simpler and better? I don't get it why someone would prefer react refs approach over this.
@CodingWithChaim4 жыл бұрын
This is a great question! I think maybe my example was a little lacking. The ref would be the better choice if you want access to the value in more than one place within the component. In your case it would be scoped to only within the useEffect
@r-i-ch4 жыл бұрын
Can you change the value of a ref?
@CodingWithChaim4 жыл бұрын
Rich Werden yes absolutely refs are completely mutable
@simongirouxportelance49564 жыл бұрын
I used a Ref to keep an Interval, because I didn't want multiple interval !
@CodingWithChaim4 жыл бұрын
indeed! very good point
@learnmaziyyah4734 жыл бұрын
FeathersJS Please
@silicongamingm111 ай бұрын
nice video
@bhavyabansal11432 жыл бұрын
Great video, only request is to please go slow. You are very fast :)
@romantyniv53813 жыл бұрын
Brilliant videos. Don't unserstand why not so many subscr. People ! hit the button to subscribe ! Thank you man!
@omrizilberstein28284 жыл бұрын
Great video! love from israel
@CodingWithChaim4 жыл бұрын
Thank you! I miss Israel
@okonkwo.ify182 жыл бұрын
Why did u keep ur face as if it’s rocket science? 😂 it’s not