From 58b2b778d8de2e84226a36eccdf58757d5567ea5 Mon Sep 17 00:00:00 2001 From: YuJian Date: Tue, 28 Jun 2022 11:48:53 +0800 Subject: [PATCH] vault backup: 2022-06-28 11:48:53 --- .../React 的深入探索 - beginWork.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md b/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md index f9f3ba3..aa4d807 100644 --- a/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md +++ b/React 的深入探索/React 的流程解析 - Fiber 递归/React 的深入探索 - beginWork.md @@ -106,7 +106,16 @@ if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { ### current 为空 -didReceiveUpdate 赋值为 false +首先 didReceiveUpdate 会被赋值为 false + +```javascript +didReceiveUpdate = false; +if (getIsHydrating() && isForkedChild(workInProgress)) { + var slotIndex = workInProgress.index; + var numberOfForks = getForksAtLevel(); + pushTreeId(workInProgress, numberOfForks, slotIndex); +} +``` ## 正式 beginWork 阶段