关于completeUnitOfWork里面nextUnitOfWork的问题
来源:6-1 completeUnitOfWork的整体流程和意义
牛Plus
2021-09-08
老师你好,completeUnitOfWork 函数的返回值如下:
if (siblingFiber !== null) {
// If there is more work to do in this returnFiber, do that next.
return siblingFiber;
}
最后是将siblingFiber返回 赋值给了 nextUnitOfWork ;我有一点不明白的是,既然这里是返回赋值给nextUnitOfWork,那为什么还要在这个方法里调用completeWork,将返回值给nextUnitOfWork
nextUnitOfWork = completeWork(
current,
workInProgress,
nextRenderExpirationTime,
);
completeWork执行完 结果给了nextUnitOfWork 最后又返回了siblingFiber 还是给 nextUnitOfWork;那completeWork的赋值操作有什么意义呢 ?
写回答
1回答
-
Jokcy
2021-09-10
不是很明白你的意思,不调用completeWork怎么给nextUnitOfWork赋值?
022021-09-14
相似问题