React Fiber 使用链表遍历组件树

Tags
frontend
Created
Jan 26, 2019 4:21 AM

https://github.com/dawn-plex/translate/blob/master/articles/the-how-and-why-on-reacts-usage-of-linked-list-in-fiber-to-walk-the-components-tree.md

React Fiber 从依赖于内置堆栈的同步递归模型,变为具有链表和指针的异步模型

  • 遍历:父节点优先,深度优先
  • 遍历的同时建立链表:类似 DOM 中的 children,sibling,parent
  • 遍历的同时只要有当前节点的引用就可以异步执行:类似 requestIdleCallback // 执行频次不足
SuperMade with Super