0

How do React Fiber and diffing algorithm connect with each other? Does React Fiber use diffing algorithm or am I trying to connect two completely different concepts because so far what I have understood is both are a part of the reconciliation process. I want to know their order of execution or if there is any overlap here.

Shachi
  • 1
  • IIRC, the fiber is what the diffing algorithm diffs against the new element tree, but I might be wrong. – Bergi Jul 04 '22 at 17:23
  • @Bergi Yes I read a little more and this is what happens. Thank You! – Shachi Jul 04 '22 at 19:11
  • For parallels, we can say that the Fiber workInProgress tree is the same as the second virtual dom created by React with changes. Diffing = Rendering phase in Fiber. Then we enter the commit phase and it's the same as firing all the write operations during reconciliation to update the original tree. Here, the current tree is replaced by workInProgress tree in "Fiber world". I could be massively wrog but this is what I got! – Shachi Jul 04 '22 at 19:18

0 Answers0