skip to Main Content

I got puzzled when I read this article about React Fiber https://github.com/acdlite/react-fiber-architecture?tab=readme-ov-file
Actually it was mentioned on the old React website
So the author of this article mentioned that:

"Conceptually, props are the arguments of a function. A fiber’s pendingProps are set at the beginning of its execution, and memoizedProps are set at the end.

When the incoming pendingProps are equal to memoizedProps, it signals that the fiber’s previous output can be reused, preventing unnecessary work."

But I questioned, isn’t it just React.memo(), like it also memoizes the result of a function if its props has not been changed

2

Answers


  1. Chosen as BEST ANSWER

    It seems, I came up with an idea, so React Fiber rerenders this component, but if its props are the same, it simply shows the previous output and side effects, but it actually calls rerender. And when we are talking about React.memo() it does not call a rerender at all. So, the main difference that the rerender process is not applied for memo(). But in my opinion, a difference in performance will not huge at all, if it will actually be.

    So, I do not guarantee that my answer is proper, so, please correct me if I am wrong


  2. This document is 8 years old. But, yes I think that it is describing the same behaviour as React.memo()

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search