just-react
just-react copied to clipboard
关于effectList 单向链表的使用已经被react废弃掉了
小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist
react官方commit更改信息:Remove remaining references to effect list #19673
We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase.
This removes all references to the effect list in the new fork.
希望能将该内容更新
小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist
react官方commit更改信息:Remove remaining references to effect list #19673
We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase.
This removes all references to the effect list in the new fork.
希望能将该内容更新
请问一下,为啥effectList 单向链表被废弃了
另外,这个PR只是被合并到了master分支。并没有说合并进了具体的某个版本的分支。
感谢反馈
小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist react官方commit更改信息:Remove remaining references to effect list #19673 We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase. This removes all references to the effect list in the new fork. 希望能将该内容更新
请问一下,为啥effectList 单向链表被废弃了
另外,这个PR只是被合并到了master分支。并没有说合并进了具体的某个版本的分支。
小书原文描述位置:https://react.iamkasong.com/process/completeWork.html#effectlist react官方commit更改信息:Remove remaining references to effect list #19673 We no longer use the effect list anywhere in our implementation. It's been replaced by a recursive traversal in the commit phase. This removes all references to the effect list in the new fork. 希望能将该内容更新
请问一下,为啥effectList 单向链表被废弃了
另外,这个PR只是被合并到了master分支。并没有说合并进了具体的某个版本的分支。
17版本已经使用了,具体原因我这边也还不清楚。
由于某些性能指标下降, subtreeTag
被重置为 effectList
。所以这部分书里暂不修改
https://github.com/facebook/react/commit/765e89b908206fe62feb10240604db224f38de7d
我看react18中也已经弃掉effectList,未恢复回effectList
由于某些性能指标下降,
subtreeTag
被重置为effectList
。所以这部分书里暂不修改
我看react18中也已经弃掉effectList,未恢复回effectList
为啥要废弃?有老哥研究了吗?
为啥要废弃?有老哥研究了吗?
看代码React 18中使用了 if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
,subtreeFlags
是当前 fiber 的子树的标识汇总,已经能防止无意义的完整深度遍历,能够更早地结束遍历,目测不再需要使用effectList来减少遍历整棵fiber tree了。
的确。effectList废弃了