Skip to content

Commit

Permalink
渲染更新流程(performWorkOnRoot)梳理,详见issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
CyfforPro committed Jul 28, 2020
1 parent c4fcc99 commit be3f446
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react-reconciler/src/ReactFiberScheduler.js
Expand Up @@ -1357,7 +1357,7 @@ function renderRoot(root: FiberRoot, isYieldy: boolean): void {

startWorkLoopTimer(nextUnitOfWork);

// 循环workLoop直到抛出异常
// 执行workloop,通过抛出可处理的错误(throwException)来“循环(continue)”,若无错误,或错误无法处理(onUncaughtError),就会跑到外面的break,结束循环
do {
try {
workLoop(isYieldy);
Expand Down Expand Up @@ -1453,9 +1453,9 @@ function renderRoot(root: FiberRoot, isYieldy: boolean): void {
// Yield back to main thread.
if (didFatal) {
// 未预期的错误,onFatal后就return了
const didCompleteRoot = false;

// 下面两个是调试相关的,不用管
// 下面三行是调试相关的,不用管
const didCompleteRoot = false;
stopWorkLoopTimer(interruptedBy, didCompleteRoot);
interruptedBy = null;

Expand Down

0 comments on commit be3f446

Please sign in to comment.