Skip to content
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

subtreeFlags是怎么代替firstEffect, nextEffect的? #49

Open
Empire-T9 opened this issue Nov 4, 2021 · 1 comment
Open

subtreeFlags是怎么代替firstEffect, nextEffect的? #49

Empire-T9 opened this issue Nov 4, 2021 · 1 comment

Comments

@Empire-T9
Copy link

最新版react代码,用subtreeFlags是代替firstEffect, nextEffect,这部分不是双链表了吗?

@creamidea
Copy link

是的,目前了解到这种是为了新的 Suspense 特性做的改造,在 commit 阶段需要再次遍历整树。能够让下面的例子中 Component 在 loading 的时候也能过显示出来

<Suspense fallback="loading...">
  // LazyComponent 需要请求远程数据才能展示
  <LazyComponent />
 
  // Component 正常组件
  <Component />
</Suspense>

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

No branches or pull requests

2 participants