-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
completeUnitOfWork 中的部分注释有歧义 #69
Comments
看源码,有以下几种情况 SuspenseComponent & DidCapture SuspenseListComponent |
谢谢大佬解答 |
深度优先:先找当前节点下是否有子节点,没有的话则查找当前节点的兄弟节点,再没有则返回父节点进行同样类型的查找。 |
completeUnitOfWork 阶段会有VDOM 的拼接操作 这个能帮忙具体定位一下代码吗?我在 completeUnitOfWork 里面没有找到。谢谢 |
这里实际上是在讨论
|
@jacty 指的vdom拼接是否就是指代的 |
确实,通过源码看出来,目前 Suspense 会出现新增 fiber 节点的操作。感谢大佬们 🙏 |
感觉这两个地方的注释是有歧义的。图二应该是相邻的下一个兄弟节点。图一的其他子节指的是父节点的其他子节点?
按理来说每次回溯到父节点,都会从左向右遍历兄弟节点,在有兄弟节点的时候都会 return 出去,然后进行外层的 while 。感觉一般情况下图一的代码好像不会被执行。
大佬能否解答下图一在什么情况下才会使 next !== null
The text was updated successfully, but these errors were encountered: