You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.2 KiB
26 lines
1.2 KiB
3 years ago
|
commitMutationEffects 对应 commit 中的 layout 阶段,leyout 阶段会遍历执行 commitLayoutEffect 方法,之前提到的 React 双缓存机制中切换 current 指针的操作也存在于这一步中[[React 的流程解析 - Fiber 递归]]
|
||
3 years ago
|
这段代码会在 mutation 阶段之后,layout 阶段之前执行
|
||
|
|
||
|
### commitLayoutEffect
|
||
|
调用 commitLayoutEffectOnFiber
|
||
3 years ago
|
当 Fiber 存在 ref 标记,会执行 commitAttachRef 函数用于处理 ref 属性
|
||
3 years ago
|
|
||
3 years ago
|
### commitLayoutEffectOnFiber/commitLifeCycles
|
||
3 years ago
|
ClassComponents 组价的 componentDidMount 和 componentDidUpdate 生命周期函数在这个函数内会被执行
|
||
3 years ago
|
|
||
|
### commtHookEffectListMount
|
||
|
遍历 effectLayout 依次执行它们 useLayoutEffect 的回调函数,这些步骤都是同步执行的
|
||
3 years ago
|
|
||
3 years ago
|
### schedulePassiveEffects
|
||
|
内部调用 enqueuePendingPassiveHookEffectUnmount 函数 和 enqueuePendingPassiveHookEffectMount 函数
|
||
|
|
||
|
### enqueuePendingPassiveHookEffectUnmount
|
||
3 years ago
|
将 useEffect 的销毁函数和 Fiber 节点一起 push 进 pendingPassiveHookEffectsUnmount 队列
|
||
|
|
||
|
### enqueuePendingPassiveHookEffectMount
|
||
|
将 useEffect 的回调函数和 Fiber 节点一起 push 进 pendingPassiveHookEffectsMount 队列
|
||
3 years ago
|
|
||
3 years ago
|
### commitAttachRef
|
||
3 years ago
|
|
||
|
### commitUpdateQueue
|