Introduction
React fiber is a reimplementation of React's fundamental algorithm that is still in progress. It is the pinnacle of the React team's two-year study.
React Fiber's purpose is to make it more suitable for animation, layout, and gestures. Its main feature is incremental rendering, breaking down rendering tasks into smaller portions and distributing them across numerous frames.
Other notable improvements include the ability to halt, abort, or reuse work as new updates arrive and the ability to prioritize different types of updates and new concurrency primitives.
Also See, Dropdown in React JS, Hooks in React JS
React Reconciliation
It's a React algorithm that compares two trees to see which sections need to be modified in the next update.
For example, suppose the component's props or state are updated. In that case, React will determine whether or not to perform a DOM update by comparing the newly returned element to the previously rendered one.
Only React will update the DOM if they are not equal. This is called reconciliation.
DOM(Document Object Model)
The Document Object Model, or DOM, is a tree data structure that the browser uses. It's a tree data structure that represents the user interface.

DOM
Stack Reconciler
Up until React 15, the previous reconciliation algorithm implementation referred to as ‘stack reconciler’ was used.
It's quite technical, and it needs a thorough understanding of the React public API, including how it's broken down into core, renderers, and reconcilers.
It also requires that you know how to distinguish between React components, instances, and elements.
In React 15 and prior, the stack reconciler was utilized. It can be found in the src/renderers/shared/stack/reconciler directory.
Element
In terms of the DOM nodes or other components, an element is a simple object that describes what you wish to see on the screen. Elements can have props that contain other elements. It is cheap to manufacture a React element. Once an element has been generated, it cannot be changed.
Reconciliation Vs. Rendering
React can render to a variety of targets, including the DOM and native Android and iOS views. The reconciler calculates which portions of a tree have changed, and the renderer utilizes that information to update the user interface.
The reconciler is re-implemented by Fiber, and it has nothing to do with rendering.
What is the need for the new architecture?
Because JavaScript is single-threaded, we only have one thread to handle all of our UI(user interface) updates, user actions, and network calls, among other things.
During the first reconciliation phase, we have two trees: a rendered current tree and an updated tree with all new modifications. The reconciler will synchronously detect the difference between these two trees in a single pass, preventing the main thread from performing other critical activities such as user actions.
Due to the way the stack reconciler operates, it has a few limitations. Because the technique is entirely recursive, every update is immediately applied. These updates can become more expensive as the DOM grows larger, resulting in dropped frames.
A UI change should also take precedence over a data storage update. Animations may appear sluggish or slow if this is not done. The stack reconciler does not distinguish updates.
As a result, as part of the React 16 release, the Facebook team has introduced Fiber as its core architecture.
Fiber's main purpose is to allow React to take advantage of task scheduling. React should be able to:
- Work can be put on hold and returned later.
- Assign different types of work different priorities.
- Work that has already been completed can be reused.
- If the task is no longer required, stop it.