Course contentsShow
← React
Lesson 1013 of 2,39626. Rules of Hooks Deep DiveFree lesson

The Fiber Tree and Hook Chains

How React's internal Fiber architecture stores hook lists as linked lists per component instance.

The Fiber Tree and Hook Chains

What you'll learn: How React's internal Fiber architecture stores hooks as linked lists per component instance.

When you learned that React uses an index-based hook registry, that was a simplified mental model. The actual implementation is more sophisticated: React maintains a Fiber tree — an internal data structure representing your component hierarchy — and each Fiber node (component instance) has a hook chain stored as a linked list.

How Hook Storage Actually Works

Each component's Fiber node has a memoizedState property. This isn't a single value — it's a pointer to the first hook in a linked list. Each hook object in this list contains:

  • memoizedState: the hook's current value (state, memo result, etc.)
  • next: a pointer to the next hook in the chain
  • queue: for state updates
  • Other metadata depending on hook type

The Linked List Structure

When you call multiple hooks in a component:

useState → next → useEffect → next → useState → next → null

On first render, React builds this chain in the order hooks are called. On re-renders, React traverses this existing chain, matching each hook call to the corresponding node by position in the list.

Why This Matters

This linked-list design explains why hook order must never change. React doesn't look up hooks by name or type — it walks the chain node-by-node, expecting the same sequence. Change the order, and hooks get mismatched with wrong nodes in the chain.

The Fiber tree allows React to track separate hook chains for each component instance, even when the same component renders multiple times.

Key Takeaway: React stores hooks as a linked list (hook chain) attached to each component's Fiber node, traversed in order on every render — making call order sacred and unchangeable.