The one thing in React that matters the most...

Sdílet
Vložit
  • čas přidán 26. 03. 2023
  • Do you need to memoize components in React? What about using hooks? I talk to Oleksandr Fediashov to see if their Fluent UI v9 performance improvements came from using memoization in React.
    This article by Kent C Dodds is the cause of much confusion. Don't trust everything you read without first testing yourself: epicreact.dev/memoization-and...
    Fluent UI's Twitter:
    / fluentui
    Oleksandr Fediashov's Twitter:
    / layershifter
    Kevin Ghadyani's Twitter:
    / sawtaytoes
    Video Edited by **Allen Pascua**: allenfpascua.myportfolio.com

Komentáře • 6

  • @behm2211
    @behm2211 Před 8 měsíci

    Great video 👍

  • @codedusting
    @codedusting Před rokem

    Example?

    • @KevinGhadyani
      @KevinGhadyani  Před rokem

      What kind of example are you wanting?

    • @codedusting
      @codedusting Před rokem

      @@KevinGhadyani some use cases where these scenarios might play out in code bases.

    • @KevinGhadyani
      @KevinGhadyani  Před rokem +1

      You me a the scenario where memoization becomes important? I don't have any code public, but I can list some situations. Most of memoization is discussed in my talk on React hooks: czcams.com/video/TmqxBA5j-f0/video.html.
      A lot of it comes down to the memoization cascade. When one thing is unmemoized, that affects the whole app.
      On one app, it was over 1000 rerenders because you typed one letter in an input for a website designer. I had to go through and retrofit memoization where it didn't exist because someone did it wrong.
      I've also worked on an image cropping tool for a stationary company. All custom, but also only smooth after memoizing. The mouse was dragging in front of the crop handles prior to memoizing everything.
      Another was for a side gig. I had 300 sections of seats to display in a stadium. Memoization helped but wasn't enough in that case; I had to add concurrent rendering.
      I also made a 10K number randomizer background for benchmarking libraries and without memoization, I couldn't do over 100 items. Memoization made 10K items possible.
      Overall site performance is faster with memoization, but that's hard to quantify. It generally feels faster.

    • @codedusting
      @codedusting Před rokem +1

      @@KevinGhadyani Thanks.