Skip to content
text
Fiber.memoizedState (组件 Hook 链表头)

┌─────────────────────────────────────────────────────────────┐
│  Hook 对象(代表一次 useState/useReducer 调用)               │
│  ├─ memoizedState : 当前生效值                                │
│  ├─ baseState     : 并发计算基准值                            │
│  ├─ baseQueue     : 🔗 历史被跳过的 Update 环形链表           │
│  ├─ queue         : 🔗 UpdateQueue 调度容器(仅状态类 Hook)  │
│  └─ next          : 🔗 指向下一个 Hook                        │
│                                                             │
│  ┌───────────────────────────────────────────────────────┐  │
│  │  UpdateQueue 对象(该 Hook 的更新管理器)                │  │
│  │  ├─ pending       : 🔗 本次新增 Update 的环形链表(尾指针)│  │
│  │  ├─ lanes         : 这些更新的优先级掩码                 │  │
│  │  ├─ dispatch      : setState/dispatch 函数             │  │
│  │  ├─ lastRenderedReducer : 上轮使用的 reducer            │  │
│  │  └─ lastRenderedState   : 上轮计算出的 state(eager优化)│  │
│  │                                                       │  │
│  │  ┌─────────────────────────────────────────────────┐  │  │
│  │  │  Update 对象(最小状态更新单元)                    │  │  │
│  │  │  ├─ eventTime  : 触发时间戳                       │  │  │
│  │  │  ├─ lane       : 优先级车道                       │  │  │
│  │  │  ├─ action     : setState 传入的值或函数          │  │  │
│  │  │  ├─ eagerState : 提前计算的结果(Bailout优化)     │  │  │
│  │  │  └─ next       : 🔗 环形链表指针                  │  │  │
│  │  └─────────────────────────────────────────────────┘  │  │
│  └───────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

🔑 一句话关系Hook身份锚点(谁的状态) → UpdateQueue调度容器(怎么管更新) → Update载荷单元(更新什么)。