Content of the Video 0:00 - Introduction 00:38 - Understanding DOM 05:30 - ReactJS Virtual DOM 08:46 - How does Virtual DOM work? 12:53 - What is Reconciliation Process in React? 14:02 - What is Diffing Algorithm? 17:48 - Wrapping Up
@farazali53352 жыл бұрын
Virtual DOM and Reconciliation: React creates a copy of original dom to avoid making direct changes in the original. When a change occurs in any state, a new copy of virtual dom is created reflecting that change, Now react will do diffing on the new and earlier virtual dom to specify the changes, And now it will batchup changes of several virtual doms finally reflect it in the original DOM. This process is called Reconciliation. Diffing Algorithm 1- If the root or parent element has changed, its child elements are considered to be changes as well and will be included in the reconciliation. 2- When checking li elements, the diff algorithm checks all elements to match for any changes or removed or new element. This takes a toll on performance and thats why keys are used when printing list items as such, to make the differentiation easier and faster.
@tapasadhikary2 жыл бұрын
Great 👏
@mrmadhan8557 Жыл бұрын
great summary thank you brother
@tapasadhikary Жыл бұрын
Most welcome 🔥
@miraclenerdkidchiki6249 Жыл бұрын
Nice summary bruv 💯
@arankengineer7947 Жыл бұрын
sir , above in line 5 , => "And now it will batchup changes of several virtual doms finally reflect it in the original DOM " ,does it mean for any event if state get change it create different virtual dom for parent and every child component ? and what if multiple states of the same component get changed for any event will it create that many virtual dom@@tapasadhikary
@martinkarugaba Жыл бұрын
I have been writing React js code for three years but I had never wrapped my head around the concept of the virtual DOM. Your explanation today was exceptionally clear. Thank you very much Tapas. Please continue doing this. I think you're really good at it.
@tapasadhikary Жыл бұрын
Thanks, Martin. I am very glad to add to your knowledge. Keep learning, Man!
@Sanyat100 Жыл бұрын
easily the best explanation in the internet about DOM
@tapasadhikary Жыл бұрын
Wow, thanks!
@irshadkk9704 Жыл бұрын
very usefull video.thanks for the wonderfull content
@tapasadhikary Жыл бұрын
Most welcome 🤗
@lindatochukwu308110 ай бұрын
I'm on the 12th video, I never understood some concepts, but going through your videos, boosted my confidence in some concepts in React JS, thank you so much for breaking it down into understandable pieces
@tapasadhikary10 ай бұрын
That’s great to hear, keep going 🚀
@ricklove8358 Жыл бұрын
man this is what i exactly needed. God bless you. Showing love from Tanzania
@tapasadhikary Жыл бұрын
Wow great 💛
@deepakkumarkhatri Жыл бұрын
Thank you, sir, for contributing to this video. You have explained everything smoothly and I've cleared all my doubts. Keep doing great work for the community.
@tapasadhikary Жыл бұрын
Super 👌
@shashankbhatgs1150 Жыл бұрын
Wow, just the right video i was looking for. Came here to understand just reconciliation, but understood so many concepts like virtual dom, diffing and especially why we use the key attribute. Thanks for making this amazing video!
@tapasadhikary Жыл бұрын
Yay, so glad to hear that. Feel free to check other videos too from the React series 👏🚀💛
@shashankbhatgs1150 Жыл бұрын
sure, definitely!
@Victor-wh9bs Жыл бұрын
Great explanation.ThankU
@tapasadhikary Жыл бұрын
Thanks a lot.
@TourManaliАй бұрын
Clear & Deep explanation
@jinoshkurisinkal3169 Жыл бұрын
Crystal clear explanation of Virtual DOM.
@tapasadhikary Жыл бұрын
Thank you, Jinosh 💙
@billypentester Жыл бұрын
best ever explanation of virtual DOM
@tapasadhikary Жыл бұрын
Wow, made my day 💛
@diamondrock4945 Жыл бұрын
Best of the best videos on DOM
@tapasadhikary Жыл бұрын
I'm so glad 💙
@mrmadhan8557 Жыл бұрын
by far the best explanation i can get on reconciliation. Thanks a lot subbed
@tapasadhikary Жыл бұрын
Welcome Madhan ✌️
@kavithakesavan89384 ай бұрын
so far the best explanation for virtual dom
@tapasadhikary4 ай бұрын
thanks a lot, Kavitha
@sumitpal8689 Жыл бұрын
Very good explanation, any dummies can understand the way you have explained. Awesome, keep doing this good job
@tapasadhikary Жыл бұрын
Great hearing that, Sumit 🤩
@faizanabbas-i7 ай бұрын
Really Helpful Video to understand these concepts. Thanks for providing such content.
@tapasadhikary7 ай бұрын
You are most welcome ❤️
@miraclenerdkidchiki6249 Жыл бұрын
I love this teaching method....its so in-depth and clearly explained...thanks so much brother👍
@tapasadhikary Жыл бұрын
Thanks a lot.
@manikaraheja2491 Жыл бұрын
Deep concepts explained in very interesting way. Thanks
@tapasadhikary Жыл бұрын
Thanks a lot, Manika ✌️
@pratikdevle58302 жыл бұрын
short and clear explanation, beginner friendly really liked it.
@tapasadhikary2 жыл бұрын
Ah, very glad.
@harshitrajani8369 Жыл бұрын
Great video please keep posting
@tapasadhikary Жыл бұрын
Sure thing! Wil do.
@techexpertpremiere Жыл бұрын
Thank you for this great explanation of React Virtual DOM. I did not know much about react virtual dom. It seems like to see your video I clear all doubt about the react virtual DOM. Again Thank you.
@tapasadhikary Жыл бұрын
I am glad that you found it helpful, Omar.
@techexpertpremiere Жыл бұрын
@@tapasadhikary Your tutorial was the main factor of clear about react virtual dom or VDOM. I think every react developer should know about the concept of VDOM. I think this concept will be help me lot in future when I will worked with react project.
@tapasadhikary Жыл бұрын
Very glad to know 🤩
@rohanthakur9159 Жыл бұрын
Thanks a lot Tapas for explaining in such a simple manner. I got to learn a lot from your video. Keep up the good work.👏
@tapasadhikary Жыл бұрын
Thanks a lot, Rohan
@MahmoudSamir-l9m10 күн бұрын
you are very genus, i have watched too many videos , this one is excellent and stands out thank you very much 😍😍😍😍
@tapasadhikary10 күн бұрын
Thank you ❤️
@tech_niks2 ай бұрын
Thanks Sir for important details.
@tapasadhikary2 ай бұрын
Most welcome
@KoushikChatterjeephp2 жыл бұрын
Owesome explanation. Better than any paid tutorial.
@tapasadhikary2 жыл бұрын
Means a lot 💙
@mumbaikapunter0072 жыл бұрын
Thanks mate, short and crisp, to the point. Keep up the good work
@tapasadhikary2 жыл бұрын
Thanks a lot, 💙
@skilful-mind Жыл бұрын
Very useful content and the explanation style is awesome .....
@tapasadhikary Жыл бұрын
Thank you! Glad it helped you.
@sugrivlodhi2607 Жыл бұрын
I realy love your way of teaching
@tapasadhikary Жыл бұрын
Thank you so much 🙏
@amindavids710 Жыл бұрын
great explanation , clear one
@tapasadhikary Жыл бұрын
Thank you 🙏
@muxtech90467 ай бұрын
Love from Pakistan, very helpful , far better than other channel not to mention they record just to sell courses , but your lectures are quite deep full of knowledge , Sir you great!
@tapasadhikary7 ай бұрын
Thank you, it means a lot ❤️
@asthadeepak Жыл бұрын
Very useful tanmay Thanks for the video
@tapasadhikary Жыл бұрын
Thanks Astha 🙏 It’s Tapas, btw 😅
@shubham564610 ай бұрын
what a teaching style and content u have amazing
@tapasadhikary10 ай бұрын
Thanks Shubham ❤️
@sublimeelectrons8699 Жыл бұрын
thank you sir @tapas! Very well explained. Now I understood why react is undoubtedly fast. I understooD DOM, Virtual DOM ,Diffing(Its like Differential signals in signal mixing) algorithm in just 18minutes. Nobody does it better than you sir. Great job again and again.
@tapasadhikary Жыл бұрын
That's great, keep going 🚀
@supershinobi7892 Жыл бұрын
i never had any lecture like this love it
@tapasadhikary Жыл бұрын
Thank you!
@khemendrabhardwaj8805 Жыл бұрын
Loved the concept . Thanks for amazing explanation
@tapasadhikary Жыл бұрын
I'm glad you liked it 👍
@fithamlakfikrie4657 Жыл бұрын
Great explanation !
@tapasadhikary Жыл бұрын
Thanks a lot 👍
@deepaksingh9928 Жыл бұрын
Superb explained
@tapasadhikary Жыл бұрын
Thank you
@visheshgupta49909 ай бұрын
Thank you so much it is very well explained good video
@tapasadhikary9 ай бұрын
Thank You
@ajayarya39142 жыл бұрын
Very clean and clear explanation. Awesome 👍
@tapasadhikary2 жыл бұрын
Thanks a lot, Ajay 💙
@praptipandey7771 Жыл бұрын
Really good explanation
@tapasadhikary Жыл бұрын
Glad you liked it.
@talhaahmad71792 жыл бұрын
Best video i found on the topic in two days 👍
@tapasadhikary2 жыл бұрын
Thanks a lot ❤️
@cyberdaria Жыл бұрын
Nice and clear vid, thanks!
@tapasadhikary Жыл бұрын
Most welcome 👏
@grabydeal Жыл бұрын
wow., amazing explanation
@tapasadhikary Жыл бұрын
Thanks a lot 👍
@tahreenbanu2812 Жыл бұрын
Very nice explanation....
@tapasadhikary Жыл бұрын
Thanks a lot, I’m glad 💛
@rishiranjan28222 жыл бұрын
Sir this is absolutely gold explanation....cleared many doubts...tysm!
@tapasadhikary2 жыл бұрын
Great, glad to know 👍
@devT44 Жыл бұрын
Sir, what is heuristic algorithm? Where does it fits in the entire process? Is it same as diff algorithm?
@akshaypatil8393 Жыл бұрын
Yes sir it is vary useful knowledge you provide. sir please make video about Routing.
@tapasadhikary Жыл бұрын
Sure
@andrewaghoghovwia19482 жыл бұрын
Thanks alot mate.. fully understood
@tapasadhikary2 жыл бұрын
Super, glad you liked 💙
@education24carat Жыл бұрын
Great lecture
@tapasadhikary Жыл бұрын
Thank you!
@sunilgeorge8864 Жыл бұрын
Good explanation brother. Keep rocking. Also put a video on React Fibre and Stack
@tapasadhikary Жыл бұрын
Thanks brother 🙏
@willianandrade13572 жыл бұрын
Very good video Tapas! But to be honest, these concepts are hard to swallow... specially the diffing algorithms. I'll rewatch your video and read the docs to fully grasp the idea. Thank you for your work.
@tapasadhikary2 жыл бұрын
Thanks, William. Please feel free to ask ur doubts in the comments section, I'll try responding as well 😊
@willianandrade13572 жыл бұрын
@@tapasadhikary The first question I have is about the diffing algorithms you talked about. You taught me how they work but didn't name them. So, if I understood correctly there's: a diffing algorithm specially for changes on root elements and their content, another one specially for changes in attributes (this one I didn't quite understand) and another one for listing content and list elements. And all of them only work in JSX, since all of this is because of the DOM and Virtual DOM shenanigans. Is this right?
@tapasadhikary2 жыл бұрын
Yes all respect to JSX as that is what constructs Virtual DOM and renders. The second one is if the root doesn't change, it compares for the attribute change. That's where diffing happens again!
@lifeofmrc Жыл бұрын
Amazing video thank you
@tapasadhikary Жыл бұрын
Thanks a lot, you are welcome.
@themelodymusic1658 Жыл бұрын
Amazing video!
@tapasadhikary Жыл бұрын
Thanks a lot 💛
@mahimagontalwar14834 ай бұрын
Thank you for your help
@tapasadhikary4 ай бұрын
I'm glad ❤️
@surajchaudhary1162 Жыл бұрын
Became ur fan 🥰 The way u explain 🔥🔥
@tapasadhikary Жыл бұрын
Wow, thanks a lot 💙
@sapnasawai5199 Жыл бұрын
It's really very useful
@tapasadhikary Жыл бұрын
Thanks a lot
@KeshavMeenuAgarwal2 жыл бұрын
Hi Tapas, Found your tutorial after searching for react js, I myself is Python Django developer, I too teach stuff related to python. I wanted to enhance myself on more modular stuff in frontend part. Your videos are great help Great stuff Also Camera and background enhancement is awesome, :) Thank you
@tapasadhikary2 жыл бұрын
Thanks, Keshav 💙. Sharing knowledge is a divine thing. Great to know you contribute to the Python community 👍.
@GoWithLyrics2 жыл бұрын
Codeevaluation is bets for React & redux
@BhagwatTandale-t7r Жыл бұрын
This video is providing much clarity abut the DOM working, but since you displaying like ,subscribe, and the bell icon at the bottom of page is distracting to user. I suggest you to that it can be showed only once at the time of video starting. NOTE: Good videos automatically gets subscribed.
@tapasadhikary Жыл бұрын
In fact, I have removed it altogether in my recent videos... Thanks for going through and as you liked it, I believe you have subscribed too 😄
@sulaimanshabbir Жыл бұрын
Thank you ❤
@tapasadhikary Жыл бұрын
Most welcome ✌️
@siddiqajamadar22832 жыл бұрын
Thank you so much for valuable information
@tapasadhikary2 жыл бұрын
You are most welcome 💙
@vishalkuwar657911 ай бұрын
Useful video 👍
@tapasadhikary11 ай бұрын
Thanks for watching ❤️
@jatilyadav4000 Жыл бұрын
Amazing video
@tapasadhikary Жыл бұрын
Thank you, Jatil 🙏
@jaycodes87902 жыл бұрын
Amazing video man!
@tapasadhikary2 жыл бұрын
Thank you
@TheCodingCollege84625 ай бұрын
Thank you boss
@shortme9374 Жыл бұрын
Liked, Subscribed. Thank you sir for making such clear and informative video.
@tapasadhikary Жыл бұрын
Thanks a lot. It’s motivating
@shortme9374 Жыл бұрын
@@tapasadhikary if possible then remove that rolling subscribe button which comes below the video. it diverts the attention.
@tapasadhikary Жыл бұрын
Will take care from new videos
@anushasurakala59757 ай бұрын
Thank you
@tapasadhikary7 ай бұрын
Most welcome.
@sakinamosavi11042 жыл бұрын
very helpful thanks
@tapasadhikary2 жыл бұрын
You are most welcome 💙
@Hrit Жыл бұрын
Thank you so much
@tapasadhikary Жыл бұрын
Most welcome
@naruto54372 жыл бұрын
excellent
@tapasadhikary2 жыл бұрын
Thanks a lot 👍
@nawarajluitel91712 жыл бұрын
Thank you sir
@tapasadhikary2 жыл бұрын
Welcome 💙
@bishwajeetpandey1570 Жыл бұрын
I have a doubt at 10:15 You said if parent component states changes then react will mark all it's child components changes . Now suppose if parent component have a use state and that use state is only used by a one child component and there are others child elements but they don't use this useState they are simply static components. And latter on when the parent use state changes due to some event will it's all child component who is not using the useState will also be marked as changes to new virtual dom and will be re-rendered on the screen. If yes then where is the performance optimization in this scenario ?
@tapasadhikary Жыл бұрын
> Now suppose if parent component have a use state and that use state is only used by a one child component and there are others child elements but they don't use this useState they are simply static components. Here are a few terminologies we need to understand. Child never gets Parent's state. A component's state is private to itself. One way the state value gets passed to child is using the props(which is not same as the state). So if A passed the props to B and B doesn't pass to C, the prop change from A to B will impact only B except the case the B itself changes in such a way the it has be teared down and built again. On top of this we can bring optimization for cases where the props is a heavily computed value or something that doesn't change often. Those cases we can think using the memo. However, it shouldn't be used often without considering if we really need it.
@bishwajeetpandey1570 Жыл бұрын
@@tapasadhikary thank u so much
@adarshjaiswal73342 жыл бұрын
What do you mean by saying in-memory object and how is it different from the real DOM obj?
@nourrahim5556 Жыл бұрын
YOU are greateeeeeeeeee
@tapasadhikary Жыл бұрын
Thank you 🙏
@sanjayshetty39212 ай бұрын
Thanks!
@tapasadhikary2 ай бұрын
OMG 😱… thanks a lot for this appreciation… 🙏🙏🙏❤️❤️
@qR7pK9sJ2t9 ай бұрын
MAGICAL !!!!
@arankengineer7947 Жыл бұрын
sir, why do not we use ordered list instead of ul , it can tell specific order of change and no need for key
@GoWithLyrics2 жыл бұрын
when you asked for special attention in video, you also started poping subscribe and like popup's...great clap for you
@tapasadhikary2 жыл бұрын
That must be a pleasing coincidence 😀. I hope you liked the content, though.
@GoWithLyrics2 жыл бұрын
@@tapasadhikary yes content is very good…i understood about VD
@random2059 Жыл бұрын
Please reply 🙏🙏🙏 So react show us illumination of actual Dom just to save computational power and under the hood it slowly update the actual Dom time to time by algorithms set ???? so getElement by Id , getElement by class goes away 😂
@tapasadhikary Жыл бұрын
It's conceptually the same but handled in memory instead of tweaking the actual DOM. Think it like, you have data store and you have replicated some portion of it in memory and perform actions on it than doing it on the DB directly. DOM methods like getElementbyxxx stays but as React is declarative(please watch the secret sauce video of React series) so it abstracts way interacting with those low level APIs directly. Thanks for watching 💛
@rashedmia78499 ай бұрын
I am waiting for Javascript advance course with dsa.❤❤❤
@tapasadhikary8 ай бұрын
That's a good ask... I will start on it after my ongoing course.
@abinavmanikantan9132 ай бұрын
beauty!
@tapasadhikary2 ай бұрын
Thank you ❤️
@murali-krishnan2 ай бұрын
Then what about React Fiber?
@chromepos2 жыл бұрын
please, do redux tutorial
@tapasadhikary2 жыл бұрын
Yeah, will do
@tapasadhikary2 жыл бұрын
It;s available now. Please check and let me know.
@ashishprasad2949 Жыл бұрын
DOM Api is provided by browser, not JS
@tapasadhikary Жыл бұрын
Yes these APIs are not core part of the language, however available as wrapper JS Web APIs developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model
@SalmanShah-w1x2 ай бұрын
Your's subscribe button is irritating Sir.
@tapasadhikary2 ай бұрын
I know.. That's why I do not use that guy anymore... that's how we learn 🙂. I hope you liked the video content though.
@SalmanShah-w1x2 ай бұрын
@@tapasadhikary No I have not liked the video yet😅😅.