From 3fd1aac18c8ded93244e612f63c359d755cce5db Mon Sep 17 00:00:00 2001 From: YuJian Date: Tue, 28 Jun 2022 10:28:53 +0800 Subject: [PATCH] vault backup: 2022-06-28 10:28:53 --- .../React 的深入探索 - beginWork.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md b/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md index ea61492..c7488bd 100644 --- a/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md +++ b/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md @@ -66,10 +66,26 @@ if ( 如果判断条件为 false,会进入后续判断逻辑 ```javascript +// props 和 context 都没有发生变化,检查优先级相关 var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); + if ( !hasScheduledUpdateOrContext && (workInProgress.flags & DidCapture) === NoFlags +) { + didReceiveUpdate = false; + return attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ); +} + +if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { + didReceiveUpdate = true; +} else { + didReceiveUpdate = false; +} ``` ### current 为空