Manipulating the DOM In ReactJS | useRef

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • Best Tech Resume Template: papermoontech....
    Use code: PEDRO for 20% off ^
    In this video I will talk about some good practices in react and go over why manipulating the DOM (Document Object Model) directly is not a good idea. However, in the cases where we have to, I am showing you guys how to use the useRef hook to make it work.
    -
    🚀 Learn ReactJS By Building 6 Projects: codedamn.com/l...
    💻 PedroTech Discord: / discord
    -
    Social
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Website: machadopedro.com
    Twitter: / pedrotech_
    Linkedin: / machadop1407
    Instagram: / _pedro.machado_
    Github: github.com/mac...
    Email: machadop1407@gmail.com
    Tags:
    DOM
    Fetch
    ReactJS Tutorial
    ReactJS and MySQL
    NodeJS Tutorial
    API Tutorial

КОМЕНТАРІ • 72

  • @maxwellosuji4096
    @maxwellosuji4096 2 роки тому +5

    I’m a newbie in react i was actually trying so many ways to manipulate a jsx element when a button is click. I’ve struggled with that for hours. Didn’t know it’s basically using “useRef”. Thanks so much i achieved so mucu from your videos

  • @realdaly
    @realdaly Рік тому +2

    I was waiting for you to show more in-depth stuff like how to change the innerHTML, using datasets and more.

  • @TriinTamburiin
    @TriinTamburiin 3 роки тому +5

    I don't really need to manipulate the DOM, but need to get a value from a hidden input, so watching this tutorial to see if useRef is that what i need :)

  • @owltrades
    @owltrades 3 роки тому +3

    Simple as that, I am a beginner in React and that's what I am looking for two weeks. You are great. Love From Pakistan ❤️❤️

  • @paulothiago5782
    @paulothiago5782 3 роки тому +5

    Searching how to make the scroll slower on my website I figured out this awesome channel. You are doing a great job, Pedro.
    Btw, your name is very common here in Brazil, so I was wondering where you from

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому +2

      Sou br kkkkkkk Meu nome é bem comum mesmo! Fico feliz que está gostando dos videos!

    • @edu-correia
      @edu-correia 3 роки тому

      @@PedroTechnologies Inglês impecável hein mano, nem consegui reparar o sotaque

  • @theavazov
    @theavazov 2 роки тому +1

    Wow very useful, you saved my IT career bro

  • @hamdanidinulhaq8683
    @hamdanidinulhaq8683 3 роки тому +1

    man, finally i found the tutorial that really useful, big thanks

  • @f3-faithfitnessfinance
    @f3-faithfitnessfinance 3 роки тому +3

    The intro is smooth🔥

  • @sanjeevdutta7760
    @sanjeevdutta7760 2 роки тому

    Really great explained, I am becoming your fan slowly, keep it up

  • @AlejandroLopez-tb4un
    @AlejandroLopez-tb4un 3 роки тому +2

    Great explanation Pedro, thanks for sharing 👍.

  • @abhishekrawat8579
    @abhishekrawat8579 3 роки тому +2

    this is it what I am waiting for.....❤️❤️❤️

  • @akashraut2402
    @akashraut2402 Рік тому

    Great work pedro.

  • @iwanttopunchtheosface
    @iwanttopunchtheosface Рік тому

    Been looking for useRef tut and yours cleared my confusion. thank you!

  • @tanayraikuwar3422
    @tanayraikuwar3422 Рік тому

    This is the video I am searching for... Thanks sir.. 😊

  • @haciendadad
    @haciendadad Рік тому

    Great video! Simple example and easy to understand. TY!!

  • @nguyenluongtrungk17dn71
    @nguyenluongtrungk17dn71 Рік тому

    thank you very muchhhh. I got it finally

  • @medipakpagare
    @medipakpagare 3 роки тому +1

    So simply explained. Very good video.

  • @leomacdon7858
    @leomacdon7858 Рік тому

    Thank you so much.. really helpful tutorial

  • @obaidabbasi7156
    @obaidabbasi7156 2 роки тому

    Nice explanation!
    Need more on dom manipulation

  • @ThColinPereira
    @ThColinPereira 3 роки тому +1

    amazing video pedroski!

  • @f3-faithfitnessfinance
    @f3-faithfitnessfinance 3 роки тому +5

    Believe it or not man, you are very inspiring in terms of productivity.
    I was able to study different stuffs before getting a job but now after getting one, I am just not able to find time.
    How do you manage to do all of these (UA-cam, job, studies and college)?
    Help me out brother😅

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому +3

      Hahaha thank you so much bro! The past year has been the most productive to me, I can make a video on how I structure my day hahaha. I work from 7 am to about 9pm so I get enough time for everything!

    • @f3-faithfitnessfinance
      @f3-faithfitnessfinance 3 роки тому

      @@PedroTechnologies Really cool man!
      Please do a video on that 👍

  • @apeiron4409
    @apeiron4409 3 роки тому +2

    useful tutorial. Thank you!

  • @jonsnow7360
    @jonsnow7360 Рік тому

    this helped me solve my issue thank you @PedroTech

  • @programer9620
    @programer9620 2 роки тому

    Thanks brother , it was really helpful.

  • @jobsal9666
    @jobsal9666 Рік тому

    your videos are very helpful i appreciate it

  • @eshw23
    @eshw23 2 роки тому +2

    Hey so is there any point of learning the DOM if it isnt supposed to be used in React?? Thank you

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому +1

      It is useful for many other libraries, and it always good to know. But for react, I would say no.

  • @pragthiyumnan6609
    @pragthiyumnan6609 11 місяців тому

    Thank you so much sir 🤩

  • @ShredBundy420
    @ShredBundy420 Рік тому

    Amazing video! Thanks for the great work :-)

  • @eherman810
    @eherman810 Рік тому

    Thank you so much ❤️

  • @antenehyehalem5963
    @antenehyehalem5963 3 роки тому +1

    your video is awesome and very explantory keep doing it

  • @pomiusu
    @pomiusu 2 роки тому

    my god I love you tysm!!!!

  • @henriquekutner6724
    @henriquekutner6724 3 роки тому +2

    Outro vídeo que está me salvando

  • @viniciusfelipipereira2666
    @viniciusfelipipereira2666 3 роки тому

    Vlw cara, vc me ajudou bastante, belo video.

  • @sadique_x_
    @sadique_x_ Рік тому

    how did you manage to draw a circle with border-radius:100%

  • @jhonrvlogger
    @jhonrvlogger 2 роки тому

    Thank you pedro is helpfull alot

  • @karanchoudhary1596
    @karanchoudhary1596 3 роки тому +2

    What's your VS Code theme ?

  • @rangabharath4253
    @rangabharath4253 3 роки тому +1

    Awesome bro 😎👍

  • @ia5852
    @ia5852 2 роки тому

    Awesome...thank you

  • @mnnw148
    @mnnw148 Рік тому

    thanks so much

  • @devarsh5317
    @devarsh5317 Рік тому +1

    are you from brazil?

  • @mofe620
    @mofe620 2 роки тому

    Thankssss

  • @Thinkerfre
    @Thinkerfre 11 місяців тому

    Useref is very important

  • @aprl
    @aprl 2 роки тому +1

    too bad the video didn't really explain why manipulating the DOM is bad or show an example

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому

      Manipulating the dom is not bad, its just against what react preaches. In react, your UI should be altered depending on the state of the application, and not manually by editing its elements. I should've made it clearer, thank you for the feedback :)

  • @parimalpatil0709
    @parimalpatil0709 2 роки тому

    Awesome

  • @romimaximus
    @romimaximus 3 роки тому +1

    I always get confused between "useRef" and "CreateRef" ....🤣

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому +1

      Hahaha no worries, useRef is the hook and create ref just creates a reference to an element

  • @juniorrodrigues3197
    @juniorrodrigues3197 2 роки тому

    Dude, how did you learn English?

  • @haroondeveloper
    @haroondeveloper Рік тому

    love from pakistan

  • @pauloh.2503
    @pauloh.2503 3 роки тому +1

    massa hein

  • @SahraClayton
    @SahraClayton 2 роки тому

    thank fuck not a video showing us how to get input to focus

  • @absurdemtiefer1950
    @absurdemtiefer1950 2 роки тому

    Holy shit - you can cut 50% of that video - stop talking in circles