|
|
@ -65,6 +65,10 @@ if ( |
|
|
|
|
|
|
|
|
|
|
|
如果判断条件为 false,会进入后续判断逻辑 |
|
|
|
如果判断条件为 false,会进入后续判断逻辑 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
此时会先调用 checkScheduledUpdateOrContext 函数检查 current 是否存在优先级相关的更新,关于 React 优先级相关我们先暂且按表不谈,进入 if 判断 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 不存在优先级相关的更新且 workInProgress 节点不存在 DidCapture flag |
|
|
|
|
|
|
|
|
|
|
|
```javascript |
|
|
|
```javascript |
|
|
|
// props 和 context 都没有发生变化,检查优先级相关 |
|
|
|
// props 和 context 都没有发生变化,检查优先级相关 |
|
|
|
var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); |
|
|
|
var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); |
|
|
@ -72,7 +76,7 @@ var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderL |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
// 不存在优先级相关的更新 |
|
|
|
// 不存在优先级相关的更新 |
|
|
|
!hasScheduledUpdateOrContext && |
|
|
|
!hasScheduledUpdateOrContext && |
|
|
|
// workInProgress Fiber 节点上不存在 DidCapture Flag |
|
|
|
// workInProgress 节点上不存在 DidCapture flag |
|
|
|
(workInProgress.flags & DidCapture) === NoFlags |
|
|
|
(workInProgress.flags & DidCapture) === NoFlags |
|
|
|
) { |
|
|
|
) { |
|
|
|
didReceiveUpdate = false; |
|
|
|
didReceiveUpdate = false; |
|
|
@ -84,7 +88,7 @@ if ( |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// current |
|
|
|
// current 节点不存在 ForceUpdateForLegacySuspense flag |
|
|
|
if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { |
|
|
|
if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { |
|
|
|
didReceiveUpdate = true; |
|
|
|
didReceiveUpdate = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|