From 8392720f134213499d33bd18e0ef26e371c08535 Mon Sep 17 00:00:00 2001 From: YuJian Date: Tue, 26 Apr 2022 16:47:42 +0800 Subject: [PATCH] vault backup: 2022-04-26 16:47:42 --- .../React 的流程解析 - commit阶段.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/React 的源码深入/React 的流程解析 - commit 阶段/React 的流程解析 - commit阶段.md b/React 的源码深入/React 的流程解析 - commit 阶段/React 的流程解析 - commit阶段.md index 4b810d2..10c35bc 100644 --- a/React 的源码深入/React 的流程解析 - commit 阶段/React 的流程解析 - commit阶段.md +++ b/React 的源码深入/React 的流程解析 - commit 阶段/React 的流程解析 - commit阶段.md @@ -113,3 +113,31 @@ do { 和 before 的循环非常类似,commitMutationEffects 也是有 invokeGuardedCallback 调用,也有着相同 Error Boundaries 的逻辑 关于 commitMutationEffects: [[React 的深入探索 - commitMutationEffects]] + +最后一个阶段:layout 阶段 + +```javascript +do { + { + invokeGuardedCallback( + null, + commitLayoutEffects, + null, + root, + lanes + ); + if (hasCaughtError()) { + if (!(nextEffect !== null)) { + { + throw Error( "Should be working on an effect." ); + } + } + var _error2 = clearCaughtError(); + captureCommitPhaseError(nextEffect, _error2); + nextEffect = nextEffect.nextEffect; + } + } +} while (nextEffect !== null); +``` + +关于 commitLayoutEffects: [[React 的深入探索 - commitLayoutEffects]] \ No newline at end of file