1
0
Fork 0
Browse Source

vault backup: 2022-04-26 16:17:42

master
YuJian 3 years ago
parent
commit
e05dd13a8f
  1. 11
      React 的源码深入/React 的流程解析 - commit 阶段/React 的流程解析 - commit阶段.md

11
React 的源码深入/React 的流程解析 - commit 阶段/React 的流程解析 - commit阶段.md

@ -20,7 +20,7 @@ do {
flushRenderPhaseStrictModeWarningsInDEV(); flushRenderPhaseStrictModeWarningsInDEV();
``` ```
中间跳过一段逻辑无关和 performance 监控代码,进入对 Fiber Tree 属性的一系列初始化 中间跳过一段逻辑无关和 performance 监控代码,进入对 Fiber Tree 和 effecrList 的一系列初始化
```javascript ```javascript
root.finishedWork = null; root.finishedWork = null;
@ -38,6 +38,15 @@ var remainingLanes = mergeLanes(
// 内部也是位运算 // 内部也是位运算
markRootFinished(root, remainingLanes); markRootFinished(root, remainingLanes);
if (rootsWithPendingDiscreteUpdates !== null) {
if (
!hasDiscreteLanes(remainingLanes) &&
rootsWithPendingDiscreteUpdates.has(root)
) {
rootsWithPendingDiscreteUpdates.delete(root);
}
}
if (root === workInProgressRoot) { if (root === workInProgressRoot) {
workInProgressRoot = null; workInProgressRoot = null;
workInProgress = null; workInProgress = null;

Loading…
Cancel
Save