Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

react 为什么使用深度优先遍历构建fiber树 而不是广度优先呢 #69

Open
zdc1111 opened this issue Mar 19, 2021 · 1 comment

Comments

@zdc1111
Copy link

zdc1111 commented Mar 19, 2021

react 为什么使用深度优先遍历构建fiber树 而不是广度优先呢

@yrui-ql
Copy link

yrui-ql commented Jan 29, 2022

相较之深度优先遍历, 广度优先遍历需要开辟额外的内存来记录一些状态变量。而且对于深度优先来说, fiberNode这种链表节点本来就是为深度遍历/回溯 这种场景设计的吧

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants