ReactJS Tutorial: What is DOM? Real DOM & Virtual DOM. Virtual DOM in React with Example 🔥

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • ReactJS is one of the most used library and one of the reason behind this is Virtual DOM. Virtual DOM is a "virtual" representation of real DOM and is local to React.
    Every tine the state of application changes, React does those changes in Virtual DOM first and then it sync the Real DOM accordingly.
    A Virtual DOM objects has same properties as a real DOM object but it doesn't have the powers to directly reflect the changes on the screen.
    Think of Virtual DOM as blueprint of a machine, changes made to the blueprint doesn't reflects on the machine itself.
    So when there is a update in the virtual DOM, react compares the virtual DOM with snapshot of virtual DOM taken right before the update of virtual DOM.
    With help of this comparison React figures out which components in the UI needs to be updated. This process is called Diffing.
    Support my channel by liking and sharing my videos so that I can reach to wider audience. Please share it in your network 🙏
    ►ReactJS Introduction
    • ReactJS Tutorial - Int...
    ►Click here to Subscribe the channel:
    studio.youtube....
    ►JavaScript Course with ES6 Features-:
    ua-cam.com/users/pl....
    ►Angular Complete Course:
    ua-cam.com/users/pl....
    ►All important shorts videos:
    ua-cam.com/users/pl....
    Connect with Me On Social Media
    Facebook: / angularjs4be. .
    LinkedIn: / nisha-sin. .
    Instagram : / nishasingla05
    Twitter: / nishasingla05

КОМЕНТАРІ • 62

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

    Excellent example. I understood the concept on a higher level before but no one explained it with such clear example. Thank You 🙆🏻‍♂️

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

    Mam nobody has explained this important concept this much clear, this is the perfect example that is required to explain the concept. Great job, Thank you so much.😀

  • @unnikuttan9637
    @unnikuttan9637 7 місяців тому

    We need more teachers like you.👍👍👍👍👍

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

    It is the best explanation anybody could have thought of...kudos Nisha

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

    I feel so Lucky for finding your channel!!! Thank you!!!

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

    What an easy and perfect explanation, glad to found your channel

  • @AbdulMajeed-lf5sq
    @AbdulMajeed-lf5sq Рік тому

    the only video that gives practical example. Thank you

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

    Clearly explained…thanks

  • @srilekhanagulakonda12
    @srilekhanagulakonda12 7 місяців тому

    I really appreciate you, Ms.Nisha, The last 2 min of the video is excellent, I didn't know before. Thank you.

  • @CodeExpress-sq5qc
    @CodeExpress-sq5qc 7 місяців тому

    Great Lecture, Thank You....Mam
    Nothing is difficult if some one explain topic like this ,,,,,,,,,
    thanks.............

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

    Such great explanation. Looking forward to learn React

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

    Nice Explanation on Reactjs....please post more and more videos... With some small project like filling forms and contact... And send to database using API...thanks alot

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

    Best explanation of Virtual DOM

  • @programmer3312
    @programmer3312 8 місяців тому +1

    Love you mam ❤❤❤ your explanation helps me a lot

  • @krantitawade3111
    @krantitawade3111 6 місяців тому

    Very important concept.. Thanks Nisha!

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

    Nyc explanation of virtual DOM 😍😍. Waiting for more videos from react

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

    wow, thanks so much! You are Awesome Nisha Mam.

  • @RamKumar-ev9id
    @RamKumar-ev9id Рік тому

    very great example.... u have a tendency to simplify complex concepts.. thanks

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

    does rendering means refreshing or updating

  • @vamshikrishna6001
    @vamshikrishna6001 10 місяців тому

    Awesome examples and explanations!

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

    Well Explained and very informative, Great job

  • @decent-style
    @decent-style Рік тому

    just great example

  • @GowthamiD-bx1bn
    @GowthamiD-bx1bn 5 місяців тому

    Thank you so muchhh I got the ans for what I'm looking for...

  • @hi-yi7en
    @hi-yi7en 2 роки тому

    I have seen so many videos On react ..your one of the best when come across react especially dom explanation...
    Do videos on Js/react interview

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

    Good

  • @rohithasamarawickrama1810
    @rohithasamarawickrama1810 Місяць тому

    very good explanation.

  • @premkatta1128
    @premkatta1128 7 місяців тому

    wonderful and simple explanation .....

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

    Wow, nice explanation. Understood

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

    Excellent explanation ma'am. Thanks a lot.

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

    Great explanation

  • @49sandeep
    @49sandeep 2 роки тому

    Perfect explaination 👌🏻👌🏻👌🏻👏👏👏

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

    Perfect explanation

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

    Very clear explanation mam

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

    Such a nice explanation...thank you...

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

    Good Job Nisha 🔥🔥

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

    you the goat. niice explanationn

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

    Now I am clear with the concept, can you tell more about reconciliation?

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

    just amazing

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

    Awesome 👍

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

    Waiting for more videos on react

  • @hooho491
    @hooho491 8 місяців тому

    thank you so much for this video, I was exactly searching for this. but I have a question, isn't it possible to do the same in plain JS what React does? Like without re-rendering the entire component just for updating the clock div?

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

    Subtle explanation. Really nice video..

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

      Thank you for your comment 😀😃🥰

  • @nishantkumar6960
    @nishantkumar6960 2 роки тому +4

    You nailed it. Good Job. Thank you so much.
    If I may ask, how much experience do you have with React and JavaScript?
    You seem to have really achieved mastery in coding.
    No one could ever explain virtual DOM like this with practical implementation and comparison 👏👏 👌, Others were only blabbering theories repeatedly 😡
    I started coding from html, css, partials, JavaScript, nodejs and then React. It's been almost 2.5 years, with 6 months of experience working in a company. The remaining 2 years I was working in some management role, I just learned & practiced at home on my own from very beginning.
    Now I'm feeling like an ass and idiot for not being smart like you. I believe you must be having atleast 5 years of experience in React. Am I Right??
    I'm sorry, I'm feeling jealous.😖

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

    What is shadow dom please explain

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

    Mam,expecting indepth videos on Angular

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

      Actually angular is declining,so everyone focusing on react

  • @DeepakGupta-hj2dv
    @DeepakGupta-hj2dv 2 роки тому

    Mam only use functional component please

  • @forza2718
    @forza2718 4 місяці тому

    This is called basic concept explanation ......you are not like the other youtubers who covered only the theory

  • @rishabhagrawal6940
    @rishabhagrawal6940 3 місяці тому

    A very bad example and was not expecting this from a channel with such good views. The React example will render the whole tree again and again
    ->setTimer is called by setInterval, a new React element tree is created.
    ->ReactDOM.createRoot is called every time, re-initializing the entire React root.
    ->This results in the entire component being re-rendered from scratch every second.
    ->The input field is reset because a completely new component tree is rendered each time.
    To fix this you need to make it a controlled component and have a timer inside the component.

  • @aboltabol77
    @aboltabol77 7 місяців тому

    wrong information

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

    Great explanation