|
|
@ -58,7 +58,21 @@ if (root === workInProgressRoot) { |
|
|
|
// 以下省略 |
|
|
|
// 以下省略 |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
然后会开始处理 effectList,因为之前 completeWork 生成 effectList 的时候并没有处理 FiberNode ,所以这里需要判断 FiberNode 是否存在 effectTag,并将其加入到 effectList 的末尾 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```javascript |
|
|
|
|
|
|
|
var firstEffect; |
|
|
|
|
|
|
|
if (finishedWork.effectTag > PerformedWork) { |
|
|
|
|
|
|
|
if (finishedWork.lastEffect !== null) { |
|
|
|
|
|
|
|
finishedWork.lastEffect.nextEffect = finishedWork; |
|
|
|
|
|
|
|
firstEffect = finishedWork.firstEffect; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
firstEffect = finishedWork; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
firstEffect = finishedWork.firstEffect; |
|
|
|
|
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
最终走到 commitRootImpl 的第一个主要循环 |
|
|
|
最终走到 commitRootImpl 的第一个主要循环 |
|
|
|