React reconciliation: how it works and why should we care

Поділитися
Вставка
  • Опубліковано 16 січ 2025

КОМЕНТАРІ • 89

  • @leonardodeslf
    @leonardodeslf Рік тому +39

    Please, never ever stop doing this!
    It's clear and explained in such a way that's easy and enjoyable to learn.
    Keep it up and thank you for sharing! 🤗🤗

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

      Thank you! 😊

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

      I agree, you have an amazing gift for teaching!

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

      ​@@developerwaypatterns I just woundering how did you get all this thing ? I just was googling for it and found your blog and videos but how did you learn it ?

  • @СергейМаркелов-м7м

    What a crazy fact with same key and conditional rendering with null!
    Bravo 👏
    Thank you for explaining these things

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

    Yeah! Your rock! There are tonnes of content for novices on UA-cam or the Internet and almost no content with advanced, "diving deep", "under the hood" stuff topics. And you provide clear explanation, code samples with code sandbox so we can play with it. There is no way we can't understand the topic. Thank you!

  • @sebabratakundu
    @sebabratakundu Рік тому +3

    I learned a lot from your posts and videos. Keep sharing your knowladge with us.

  • @Arzen84
    @Arzen84 Рік тому +3

    I love your articles and I very much appreciate you taking the time to make a video of some of your articles!
    The way you break down the concept is brilliant! Once again, thank you so much!

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

    Haven't seen such easy explained detailed video ever. Really helpful. Hope to have more like this.

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

    Your videos and blog posts are just amazing keep up with the awesome job!

  • @ibrahimmohamed856
    @ibrahimmohamed856 Рік тому +4

    Thanks for the information it clears a lot of confusing concepts in react that may make juniors struggle ❤

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

    I love your explanation, very clear and concise ❤

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

    Amazing! That is the content I was looking for!

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

    Thanks, your videos are always a pleasure to watch because I love under the hood stuffs and your delivery is very engaging.

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

    Incredible explanation

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

    This is simply the best explanation

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

    Thank you so much, Nadezhda! The article is brilliant

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

    You're amazing dude. Awesome explanation.

  • @aissanadjemeddine1330
    @aissanadjemeddine1330 10 місяців тому +1

    Thank you so much for this videos 💓💓💓

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

    Really love your videos, thanks for the great work!

  • @daniel.w8112
    @daniel.w8112 6 днів тому

    This was just amazing! subscribed.

  • @MS-el8wj
    @MS-el8wj Рік тому

    One of the best explanation for reconciliation. I loved it. Thanks for your time

  • @LinhNguyen-bp9hd
    @LinhNguyen-bp9hd Рік тому +1

    I'm impressed with React re-renders guide: everything, all at once that's why I came here, thanks for the content
    is it your real voice or machine?

    • @LinhNguyen-bp9hd
      @LinhNguyen-bp9hd Рік тому

      would appreciate if you can recommend any good book on react
      kind of a deep dive like what you are doing

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

      I'm about to release a book about exactly that in a few days, subscribe here: advanced-react.com/ :)
      The voice is real :)

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

    super helpful finaly have a better understanding of react reconcilliation

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

    gold content.
    thank you.

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

    Muchas gracias por el contenido, que forma tan sencilla de explicar conceptos más avanzados

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

    Amazing explanation ❤

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

    amazing video! you have a great teaching style

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

    Really very helpful video. lots of knowledge thanks for sharing with us ❤

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

    i love so much your work. Thanks :D

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

    amazing! Thank you so so much!

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

    great job Nadia!

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

    Большое спасибо за видео, очень интересно и познавательно. У вас хорошо получается доносить материал. И еще раз большое спасибо)

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

    I am newbie to React so didnt't understand it completely as this seems advanced but I still got one aha moment.
    Subbed! 🙌

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

    Надя, спасибо, познавательно!

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

    Your tutorials and articles are amazing and of deep knowledge.
    Can you please share how and what tools you use to create UA-cam videos?
    Really your explanations are too the point and simple.

  • @this-user-is-not-loser
    @this-user-is-not-loser 4 місяці тому

    Cool! Thanks!

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

    I love your videos and blogs so much! Keep going and I will always support you! Btw, I really like your editor theme, do you mind to share with me? Thank you and happy coding!

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

      Aww, thank you! 😊
      It's not my editor, it's "Material" theme from carbon.now.sh/ 😅
      But maybe can be installed in VSCode, don't know tbh

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

    Thank you!

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

    soo good!

  • @hossamkamal2459
    @hossamkamal2459 9 місяців тому

    That was clear and concise, thank you. Please, could you create those types of videos covering JavaScript object-oriented programming design patterns as well?

  • @LauraLopez-uu2nn
    @LauraLopez-uu2nn 8 днів тому

    Thanks so much for creating this type of content, it's so engaging and interesting to watch.
    After watching this I became curious about the virtual dom, is there any way to see what it actually looks like in a real React app?

    • @developerwaypatterns
      @developerwaypatterns  8 днів тому

      The entire three you mean? No idea
      But you can just console.log an element and see the type and the props and other things there

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

    I couldn't understand this topic from react docs thank you so much

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

    Thank you

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

    this is god-tier

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

    Thanks !

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

    Thanks a lot for the video, as always instructing content. Just a question, what tool did you use to animate and display code examples ?

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

    Hi Nadia, Thanks for such a beautiful explanation. I have a doubt regarding the calling the component function outside. Can't we just use a useCallback hook to store the same reference of the component?

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

      If it doesn't depend on the state, then we indeed can, but what for? Much easier to move it outside. If it does depend on the state, then it will re-mount every time the state changes.

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

    Hi Nadia, Awesome stuff like how updates happens under the hood. But I have one question, regarding the example that you have used here, (link of CodeSandbox), the state(input of tax) will only persists, because we are not using controlled input right? if we were to provide value prop for Input which we more likely are then this will not happen right? I do understand the point of this example is for you to explain how DOM nodes are compared, Still wanted to know more about this. Cheers

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

      Yep, exactly! Controlled state will belong to the parent, so there will be no weird side-effects like that.
      It's just input is the easiest way to create a meaningful example of a component with local state :) But the same situation will be with anything that holds its own state that is not synced with the parent

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

      @@developerwaypatterns Great Thank you for getting back to me. And I am so glad I found your article/blogs they are just nuggets of gold. Cheers

  • @MauricioCorzo-g7v
    @MauricioCorzo-g7v Рік тому

    Great explanation! Next time you can make a video explaining the differences between manipulating the real DOM and the Virtual DOM and how is the diff algorithm?

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

    god tier!

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

    thank you so much for the video! i was just starting to study the source code of react and this helps a ton. i do have a question tho. is the diffing alg a part of fiber architecture?

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

      It's implemented and used in fiber architecture, yep, but it existed before it. And not necessarily tied to it, other frameworks can use it as well.

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

      @@developerwaypatterns gotcha thank you :)

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

    Thank you so much, I think I have found a gem :) . Could you give more information about reactDom library vs react itself. As I know, reconcilation is done thanks to reactDom while diffing algorithm is handled by react library itself. When we do reactDom.render() all logic is started and reconcilation is started. Then, react element tree is created thanks to react library ( since there is a react.createElement ). What actually reactDom is doing? it just syncing real dom with virtual dom am I right? If so, reconcilation is handled by react library itself since it creates element trees? I am confused of that part

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

    Quality content

  • @4BeerLife
    @4BeerLife Рік тому

    thx!

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

    I came back to this video to clarify my understanding of React Reconciliation Algorithm and I have a question related to "Components inside other components" part of this video:
    Firstly, React will shallowly compare both React Elements by reference, since we have created a new React Component inside our current Component it will be recreated every re-render and the returning Element will be also always different, so this comparison will always return false.
    Also after watching your video "Elements, Children and Re-renders - Advanced React course, Episode 2" I found out that React won't trigger re-render if children React Elements are the same by reference and the only way to implement this is to use React Elements as props. React will compare them and will find out that they are the same and won't trigger re-render.
    My question is: If we will create React Component outside of the current Component it will save reference for the Component Function, but the returning Element will be always different and React Reconciliation will fail first shallow comparing, right? So whats the difference if we will declare React Component inside or outside of the current Component because anyway the returning React Element will have always different reference? Is it all about saving reference for the React Component Function?
    Thank you!

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

      > Is it all about saving reference for the React Component Function?
      This is exactly right :) If the Element changes (as will happen in both cases), but the "type" property is the same (as will happen with the reference to it, if it's declared outside) - then the component, that is represented by that Element, will just re-render.
      If the "type" changes as well - as will happen if the component is declared inside, then the component will re-mount. I.e. it will be destroyed and re-created from scratch.

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

      @@developerwaypatterns Thank you ;)

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

    Hey, how do you create the animations?

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

    Could you also explain another fancy word on React called "referential equality" ? Is it related to reconciliation ?

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

      No, it's how javascript compares functions, objects and arrays (non-primitive values). It's happening not by their actual value, but by the reference to a value. So two identical arrays/functions/objects, when compared, will return false:
      ```
      const a = [1,2];
      const b = [1,2];
      a === b; // will be false
      ```
      Only if those variables are pointing to the same object, the comparison will be true:
      ```
      const a = [1,2];
      const b = a;
      a === b; // will be true
      ```
      developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness

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

      @@developerwaypatterns Hmm, so the non-primitive values are passed by reference instead of a new copy of them. It finally clicks now :D I can't thank you enough 💚

  • @khaledloda5418
    @khaledloda5418 17 днів тому

    Thanks for Great explanation , but want ask about create component inside another we can use
    useCallback to create component it works fun ?!!
    ex
    const CustomInput = useCallback(() => {
    console.log("rendering custom input");
    return ;
    }, []);

    • @developerwaypatterns
      @developerwaypatterns  17 днів тому

      Like this, without any dependencies - yep, but what for? :)
      And as soon as dependencies appear there, the component will be re-created and as a result - the same problem with re-mounting

  • @TheTrippyTerminal
    @TheTrippyTerminal 10 місяців тому +1

    Thats it, friendship broken with React.

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

    Hmm if the inputs are stateful, say by a useState hook for each this behavior does not happen, good but why?

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

      Can you share the code? Is state controlled by the inputs or by the parent?

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

      @@developerwaypatterns the state is controlled by the parent, same code just add 2 hooks for each input.

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

      If the state is controlled by the parent, then those input don't hold their own state. And for bug to be visible, inputs should have something that they control independent of the parent

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

    components cannot be created inside components... unless it's a memo))))

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

    Wow just yesterday I try to understand fiber tree data structure by asking chatgpt and today I found this video that explain it clearly better than chatgpt, thank you for creating this video 🫡