frontend

React Fiber

January 24, 2026

React Fiber

Overview

React Fiber is an internal implementation detail of the React library. It's a complete reimplementation of the core algorithm used by React to reconcile the virtual DOM and update the actual DOM efficiently. The main goals include better performance, improved developer experience, and the ability to enable new features like async rendering.

Evolution

Before React 16: Stack Reconciler

  • React used a recursive process for rendering and updating the virtual DOM
  • It operated on a single call stack, which meant that the entire reconciliation process had to complete before yielding to the browser
  • This could cause performance issues and jank in the UI

After React 16: React Fiber

  • Reconciliation algorithm using a new architecture called "fiber"
  • It breaks down the reconciliation process into smaller, interruptible units of work
  • Allows React to pause and resume work as needed
  • The term "fiber" refers to these individual units of work

Key Features

1. Concurrency

React Fiber introduces the concept of concurrency, enabling React to work on different tasks concurrently without blocking the main thread. This helps in creating more responsive user interfaces.

2. Incremental Rendering

Fiber allows for incremental rendering, where React can work on rendering parts of the virtual DOM without completing the entire process in one go. This is particularly beneficial for large and complex applications.

3. Prioritization

Fiber introduces the ability to prioritize different types of updates. It can schedule high-priority updates (e.g., user interactions) ahead of low-priority updates, improving perceived performance.

4. Error Boundaries

Fiber improves error handling and provides better support for error boundaries, making it easier for developers to capture and handle errors within components.

Why Fiber Was Introduced

Improved Performance

The main motivation behind React Fiber is to improve the performance of React applications, making them more efficient and responsive.

Concurrency

Concurrency allows React to better utilize resources, preventing the UI from freezing during heavy computation or rendering tasks.

Better Developer Experience

Fiber's architecture makes it easier for developers to work on the codebase and introduces features like time-slicing, enabling smoother animations and interactions.

Preparation for the Future

React Fiber is designed to be more extensible, making it easier for React to evolve and adopt new features and optimizations in the future.

How Fiber Works

Fiber Nodes

Each component in React corresponds to a "fiber" node that contains:

  • Type of component
  • Props
  • State
  • Child and sibling references
  • Work to be done

Work Loop

Fiber uses a work loop that can:

  • Pause work
  • Prioritize work
  • Resume work
  • Cancel work if needed

Scheduling

Fiber can schedule work based on priority:

  • Synchronous: Immediate (like user input)
  • Task: Should complete soon (like animations)
  • Normal: Default priority
  • Low: Can be deferred (like offscreen updates)

Benefits

  1. Better Performance: More efficient rendering
  2. Smoother Animations: Time-slicing prevents jank
  3. Better UX: Prioritizes important updates
  4. Error Handling: Improved error boundaries
  5. Future-Proof: Enables new features

Best Practices

  1. Use React 16+: Take advantage of Fiber
  2. Optimize Renders: Use React.memo, useMemo
  3. Code Splitting: Split code for better performance
  4. Lazy Loading: Load components on demand
  5. Monitor Performance: Use React DevTools Profiler