useRef hook in reactjs | Easiest way

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.
    All the learning resources such as code files, documentations, articles and community discussions are available on our website:
    chaicode.com/
    You can find our discord link, github link etc on the above website.
    Twitter/X link: x.com/hiteshdo...
    Discord link: hitesh.ai/discord
    Learn React with 10 projects: • Let's learn react from...
    Learn Docker: • A practical guide on D...
    Learn Kubernetes: • Complete Kubernetes Co...
    How does a browser works: • How does a browser wor...
    How nodejs works: • How node JS works | En...
    Learn Redux-toolkit: • Learn Redux Toolkit in...
    Learn NextJS: • Nextjs Full stack course
    Learn Typescript: • Why to learn Typescript
    Learn Javascript: • Welcome to new JavaScr...
    Learn React Native: • React Native Mastery: ...
    Learn Zustand: • React state management...
    Learn Golang: • How to get started wit...

ความคิดเห็น • 208

  • @mazharulislam214
    @mazharulislam214 3 ปีที่แล้ว +35

    after seeing so many focus based tutorial finally this was the one that helped me understand the concept clearly. Thank you very much to you.

    • @arulprasad4786
      @arulprasad4786 2 ปีที่แล้ว +1

      Yea...This one made lot more sense..

    • @DoUSuggon
      @DoUSuggon 2 หลายเดือนก่อน +1

      Yes, its 2024 and many youtuber are still giving example based on focus 😂😂

  • @ujjawal.pandey
    @ujjawal.pandey 3 ปีที่แล้ว +13

    Literally cracked me up when you talked about that focus example.

  • @alkhamistic
    @alkhamistic 3 ปีที่แล้ว

    I really really appreciate the fact you didn't do the reused 'focus' tutorials everyone copied off each other. Much appreciated.

  • @VenkatGudavalli
    @VenkatGudavalli 3 ปีที่แล้ว +29

    Netlfix style Intro should be continued 😅

  • @NoOne-zu5qm
    @NoOne-zu5qm 3 ปีที่แล้ว +4

    I know sir you won't read this comment but Thank you so much sir I have completed your mern course and that gave me so much confidence in creating React and other full stack web applications. Again thank you sir from the bottom of my heart.

  • @samadritsarkar2
    @samadritsarkar2 3 ปีที่แล้ว +4

    I was struggling with ReactJs for the last few days. Thanks for the last 2 videos. You are awesome 💯

  • @chandrakantshinde6
    @chandrakantshinde6 3 ปีที่แล้ว +6

    you know what i have never build a production ready app or any project yet but still i enjoy these videos and interestingly i'm getting almost everything what he is talking, making improvement in something is always exciting and fun. please make such great videos

  • @danielakoyleek3757
    @danielakoyleek3757 ปีที่แล้ว +2

    Finally i can get my head around this confusing hook. First time watching your channel but really loved the explanation. Many many thanks to you.

  • @theodiclick6847
    @theodiclick6847 3 ปีที่แล้ว +2

    This is the best and simplest way that I find for this hook
    Thank you so much, sir.

  • @phunguyeninh5707
    @phunguyeninh5707 2 ปีที่แล้ว

    I really confuse when see my colleague use useRef in their code, but I got the whole ideal when watch this video. Thanks Hitesh so much

  • @riversound8871
    @riversound8871 11 หลายเดือนก่อน +1

    Thanks Hitesh. Got more clear understating of useRef.

  • @vaibhavsachdeva.2001
    @vaibhavsachdeva.2001 ปีที่แล้ว +2

    You explain things so well and with patience. Thanks!

  • @prithvimd9091
    @prithvimd9091 2 ปีที่แล้ว

    The simplest yet the clearest video on the internet!

  • @AbhisekMaitiOfficial
    @AbhisekMaitiOfficial 10 หลายเดือนก่อน +1

    Better than 500 rupee udemy course, love you sir ji

  • @funshot4782
    @funshot4782 3 ปีที่แล้ว +1

    Now, i explain many react concepts very easily to anyone, all credit goes to you. Hitesh Sir ##MyDrodhachaarya🙏🙏

  • @tsdineshjai8565
    @tsdineshjai8565 3 ปีที่แล้ว +1

    Wow ! Got to say this is one of the simplest and neat explanation a layman can understand.

  • @ashishkumarsaini7192
    @ashishkumarsaini7192 3 ปีที่แล้ว +2

    Thanks! I m just working on a project and need to implement useRef in that. Really helpful 😊

  • @pemaangyagurung848
    @pemaangyagurung848 2 หลายเดือนก่อน

    after going through multiple videos and not understanding the concept, there comes hitesh sir ❤❤❤

  • @qasimhafeez3402
    @qasimhafeez3402 3 ปีที่แล้ว +1

    Now I can say I know what is useRef, great work Sir

  • @saikiran-ng8bp
    @saikiran-ng8bp 3 ปีที่แล้ว

    Now I got a clearly understanding of where we can use useref. Thank u

  • @yashmengji6455
    @yashmengji6455 3 หลายเดือนก่อน +1

    Everytime you surprise me with your knowledge

  • @ak39gaming
    @ak39gaming 10 วันที่ผ่านมา

    was this video longer nah dude ! 20 minutes felt like 2 minutes. love your teaching style .

  • @ishukhurana1779
    @ishukhurana1779 3 ปีที่แล้ว +2

    Completely different example used from all the other videos on youtube for useref!! Great Work. Just one ques: isn't changing the width of input box a re-render???

  • @sunflair-wa
    @sunflair-wa 2 ปีที่แล้ว

    You had me at, You have to understand it's history!

  • @InderjeetSingh-zm3sf
    @InderjeetSingh-zm3sf ปีที่แล้ว

    Thanks sir made my mind more clear about useRef() hook

  • @kalidass5968
    @kalidass5968 3 ปีที่แล้ว

    You are always unique. Different examples are giving better idea. Very useful. Thank you!

  • @tharunchowdary14
    @tharunchowdary14 3 ปีที่แล้ว +2

    Really loving all the content of your channel❤️

  • @yashpanchal8464
    @yashpanchal8464 2 ปีที่แล้ว

    Thank you so much sir for this simple and useful video and I don't feel that video is longer.

  • @akashgite4865
    @akashgite4865 3 ปีที่แล้ว +2

    Sir, please make video on useMemo() and useCallback() hook

  • @rajeshbhattarai5934
    @rajeshbhattarai5934 2 ปีที่แล้ว +1

    clear and concise. Loved it

  • @jasper5016
    @jasper5016 2 ปีที่แล้ว

    Thanks a lot Hitesh. I watched so many videos but this is the best explanation useRef can have. Thanks man!! I hope you make bigger videos and your subscribers will be very happy to watch them. :)

  • @aniketjha1729
    @aniketjha1729 3 ปีที่แล้ว

    one of the cleanest explanations one can find on the internet... ❣️❣️

  • @DONGNebab
    @DONGNebab ปีที่แล้ว

    damn , my 20mins time of my life not waste for watching this tutorial man, thank you for explaining it. . new subscriber here.

  • @santana1971
    @santana1971 3 ปีที่แล้ว

    it took me a while to find a clear explanation of useRef. sure i will subscribe and follow you always mr.hitesh

  • @vijayr.b.1050
    @vijayr.b.1050 3 ปีที่แล้ว

    Your video covers concept and interview qns too. Thanks a lot for this video sir!

  • @AshishKumar-DIYCode
    @AshishKumar-DIYCode ปีที่แล้ว

    This is awesome video it clears my all doubts.

  • @madhuiitb-cse
    @madhuiitb-cse ปีที่แล้ว

    Best video on useRef

  • @arulprasad4786
    @arulprasad4786 2 ปีที่แล้ว

    You are my Guru going forward. Dheivamey.......

  • @mindbodyps
    @mindbodyps 2 ปีที่แล้ว

    Best tutorial on useRef, no doubt

  • @niteshkushwaha9493
    @niteshkushwaha9493 10 หลายเดือนก่อน

    Concise and complete explanation

  • @letshope5646
    @letshope5646 11 หลายเดือนก่อน

    thanks much Hitesh....you are having an incredible teaching ability.

  • @athuljyothis1951
    @athuljyothis1951 3 ปีที่แล้ว +1

    you are good at this

  • @Lafsha
    @Lafsha ปีที่แล้ว

    best explanation so far

  • @RiteshNEVERUNIFORM
    @RiteshNEVERUNIFORM ปีที่แล้ว

    Thanks a lot. I now have a better understanding. Gotta say please Inculcate these philosophy part in courses too. I was disappointed by one of your course but your youtube videos seem to be more curated than courses

  • @kaszapnagypeter
    @kaszapnagypeter 3 ปีที่แล้ว

    Best explanation I have ever heard about useref hook!

  • @venkatchalam6385
    @venkatchalam6385 2 ปีที่แล้ว

    superb explanation hitesh sir,thank u so much

  • @tomasgilamoedo8301
    @tomasgilamoedo8301 2 ปีที่แล้ว +1

    Excellent video bro! really appreciated

  • @ameeraabed637
    @ameeraabed637 2 ปีที่แล้ว

    thank you so much Iam enjoying when I watch your explanation 😊😊😊

  • @azizulhakimashik1154
    @azizulhakimashik1154 3 ปีที่แล้ว

    Best Tutorial. Watched from Bangladesh :)

  • @Yash-ry5wj
    @Yash-ry5wj ปีที่แล้ว +1

    Crystal Clear❤❤

  • @RicheRichLive
    @RicheRichLive ปีที่แล้ว

    THE best video i have even seen

  • @nabilkachar-k2n
    @nabilkachar-k2n 11 หลายเดือนก่อน

    you explain the why of things and that what does give your channel its adventage upon others

  • @ahmedmohned387
    @ahmedmohned387 2 ปีที่แล้ว

    Thank you sir for this wonderful tutorial.

  • @NonBinary_Star
    @NonBinary_Star 2 ปีที่แล้ว

    Best description I've seen!

  • @amolshrivastava7786
    @amolshrivastava7786 3 ปีที่แล้ว +1

    This explanation was phenomenal. Can you explain in depth useEffect hook and all its cases?

  • @justanotherfilcitizen2682
    @justanotherfilcitizen2682 2 ปีที่แล้ว

    This useRef confuses the sht out of me, after watching your vid, i now somehow understand it

  • @ramganeshrg4125
    @ramganeshrg4125 2 ปีที่แล้ว

    The concept is explained clearly....... thankyou bro.

  • @parasmaniseth7873
    @parasmaniseth7873 3 ปีที่แล้ว

    we getting into in-depth react ...nice...looking forward to the video on lifecycle component of react

  • @harshavardhanteja6727
    @harshavardhanteja6727 3 ปีที่แล้ว +1

    As said in the Saturday live, thought yesterday would be live with telusko

  • @garvitvanshkataria
    @garvitvanshkataria 3 ปีที่แล้ว

    Great explanation and example

  • @bipinmsit7380
    @bipinmsit7380 3 ปีที่แล้ว

    Great explanation @Hitesh! You simply cracked useRef :)

  • @oncoding4520
    @oncoding4520 ปีที่แล้ว

    Hello :) Thank you for taking the time to explain it. It was such a great great video, but I just want to mention something that you already spoke in the beggining of the lesson. From a student perspective we usually go for longer or medium videos and 20min video its I think quite good. I refuse to see videos about 5min for each conxept. Coding is about conxepts and not syntax. You can steel code up and down but its more useful if you steel code but at least you understand the flow of the code and you can modify when you are asked. So thank you again for your work.

    • @oncoding4520
      @oncoding4520 ปีที่แล้ว

      I dont hit the subscribe sorry...

    • @oncoding4520
      @oncoding4520 ปีที่แล้ว

      I just make the notification ON for each video that you will upload

  • @tanmayagarwal1356
    @tanmayagarwal1356 2 ปีที่แล้ว +2

    If useRef doesn't cause re-render then how the text box size got bigger, because any change in DOM Elements can only be visible when it gets re-rendered. Please correct me if I am wrong. And thanks a lot Hitesh, it was a great video with amazing explanation.

    • @digvijayyamagekar7139
      @digvijayyamagekar7139 ปีที่แล้ว +1

      That's because when we use useRef it returns a actual DOM reference and when you edit the actual DOM you don't need re render to see those changes, they are applied directly

    • @Shambhabya_Medhi_
      @Shambhabya_Medhi_ 10 หลายเดือนก่อน

      thanks@@digvijayyamagekar7139

  • @ReshmaShaik-ug5oy
    @ReshmaShaik-ug5oy 9 หลายเดือนก่อน

    tq very much sir it was easy to understand

  • @brothersumitkumar
    @brothersumitkumar 3 ปีที่แล้ว

    Awesome explanation!!! Thank you so much @Hitesh Sir! for creating such a nice video for all viewers who are learning react like me. For me the best part of the video was the summarization of whole concept in last. I changed my video playback speed to 0.75 to understand what you just said. LOL!!!

  • @nevermindshort3
    @nevermindshort3 2 ปีที่แล้ว

    Thanks for the explanation in the beginning. It was really helpful

  • @alonaalona5967
    @alonaalona5967 2 ปีที่แล้ว

    Thank you very much :) Only your video gave me understanding of useRef

  • @amansarma417
    @amansarma417 3 ปีที่แล้ว

    I was just wondering on how to manipulate on dom elements wola! I just got my answer thank you sir.

  • @chandravardhan3725
    @chandravardhan3725 3 ปีที่แล้ว

    Sir, You are too much like my mom. You always sense it, what I want.

  • @jamalashraf7957
    @jamalashraf7957 2 ปีที่แล้ว

    you are AWESOME! BEST EXPLANATION EVER!

  • @ziaahmad8738
    @ziaahmad8738 3 ปีที่แล้ว

    Wao thank you very much, your videos are really helpful. I just started learning react and these videos are great help and I don't mind long videos at all 💓

  • @iafofkhadze4628
    @iafofkhadze4628 2 ปีที่แล้ว

    wow this is best video so far. really appreciate your help tho

  • @hapatworld
    @hapatworld 2 ปีที่แล้ว

    sir tagda explanation hain.

  • @amarmohammed5644
    @amarmohammed5644 2 ปีที่แล้ว

    Brilliant explanation, love the detailed answer

  • @usamanayab8381
    @usamanayab8381 2 ปีที่แล้ว

    you have cleared it amazingly! 👏

  • @easyfinanceexplained
    @easyfinanceexplained 3 ปีที่แล้ว

    Thank You sir for this beautiful concise explanation!!!!!

  • @mayanksahu5172
    @mayanksahu5172 3 ปีที่แล้ว

    Thankyou for this type of clearlity ❤️

  • @RajveerSingh-yb6zq
    @RajveerSingh-yb6zq 3 ปีที่แล้ว +3

    Absolutely Beautiful :)

  • @ice12328
    @ice12328 ปีที่แล้ว

    Excellent explanation .

  • @pavanshirguppi5261
    @pavanshirguppi5261 3 ปีที่แล้ว

    Good Hitesh. Keep it up.

  • @sehajdeepsingh7427
    @sehajdeepsingh7427 2 หลายเดือนก่อน

    Brilliantly explained !!

  • @idrissben1613
    @idrissben1613 2 ปีที่แล้ว

    Thank you , it was very clever!

  • @pythusiast4701
    @pythusiast4701 ปีที่แล้ว

    Amazing teacher

  • @AtitManandhar
    @AtitManandhar 3 ปีที่แล้ว

    Thank you for the clear explanation.

  • @randomandrandomfacts
    @randomandrandomfacts 3 ปีที่แล้ว

    Really needed this video. Thank you.

  • @muhammad_abir
    @muhammad_abir 2 ปีที่แล้ว

    thanks a lot.... you made it easy
    please a video like this about redux.... what is the use case of redux!

  • @narutokunn
    @narutokunn 3 ปีที่แล้ว

    Thanks for the clear explanation

  • @nabinsaud4688
    @nabinsaud4688 3 ปีที่แล้ว

    We need more ... please make More

  • @itsjaysenofficial
    @itsjaysenofficial ปีที่แล้ว

    Great explanation!!! ❤

  • @cosanostraytc1030
    @cosanostraytc1030 2 ปีที่แล้ว

    Excellent tutorial man. Keep it up!!!

  • @developerpranav
    @developerpranav 2 ปีที่แล้ว

    Such a great explanation! Thank you sir!

  • @SaurabhYadav-cf5sq
    @SaurabhYadav-cf5sq 2 ปีที่แล้ว

    Please make react playlist and clear all the concepts easily 😊

  • @andyfer7716
    @andyfer7716 3 ปีที่แล้ว +2

    I'm confused. Useref is not supposed to render but clearly the input element is changing in width which means it was re-rendered. What am I missing?

    • @mayurkeswani2312
      @mayurkeswani2312 3 ปีที่แล้ว

      Re-rendering means re-loading of browser tab. If you use useState , with every change in state , your browser will re-load and all elements on that page will too re-reload.
      but in useRef , that element will only re-render not browser tab.

    • @andyfer7716
      @andyfer7716 3 ปีที่แล้ว

      @@mayurkeswani2312 I don't think that's right.

    • @fariduzzamaansari1656
      @fariduzzamaansari1656 3 ปีที่แล้ว

      When you are using useRef and do something like:
      inputRef.current.style.width = "400px"
      It means that you are manipulating the DOM manually, meaning, you are not causing a re-render in the React sense, although you may very well be causing a repaint or reflow. React handles all the DOM manipulations itself so that you don't have to, it handles when something should re-render through the 'state' and virtual DOM.

  • @temitopeasama912
    @temitopeasama912 2 ปีที่แล้ว

    This was lovely. Thank you!

  • @sohamgodbole1587
    @sohamgodbole1587 3 ปีที่แล้ว

    Awesome sir. As always.please make Video on redux or redux toolkit with demo app like todo.If possible.

  • @johnosaze
    @johnosaze 2 ปีที่แล้ว

    Please can you make a video on shortcuts used in VS Code

  • @muditrustagi3356
    @muditrustagi3356 3 ปีที่แล้ว +1

    18:20 did anyone notice the console log showed width as 400, although the code to change width was sequentially after logging statement, ideally i would have expected it to show as width:100. Can anyone tell me why did that happen?

    • @hi-yi7en
      @hi-yi7en 2 ปีที่แล้ว +1

      Because here we log the non- primitive value thats why....

  • @jdragon8184
    @jdragon8184 3 ปีที่แล้ว

    It's my first time learning anything from him and it's awesome
    Ps:subbed already but permanent now

  • @sarthem
    @sarthem 3 ปีที่แล้ว

    Great video tutorial thanks a lot!

  • @tsdineshjai8565
    @tsdineshjai8565 3 ปีที่แล้ว

    I was searching if I could find explanations for other Hooks, I couldn't find it . Could you kindly let me know about that ?