We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://segmentfault.com/a/1190000041094886
The text was updated successfully, but these errors were encountered:
在React的concurrent模式下,低优先级任务执行过程中,一旦有更高优先级的任务进来,那么这个低优先级的任务会被取消,优先执行高优先级任务。等高优先级任务做完了,低优先级任务会被重新做一遍。
高优先级任务插队,低优先级任务重做的整个过程共有四个关键点:
ensureRootIsScheduled取消已有的低优先级更新任务,重新调度一个任务去做高优先级更新,并以root.pendingLanes中最重要的那部分lanes作为渲染优先级 执行更新任务时跳过updateQueue中的低优先级update,并将它的lane标记到fiber.lanes中。 fiber节点的complete阶段收集fiber.lanes到父级fiber的childLanes,一直到root。 commit阶段将所有root.childLanes连同root.lanes一并赋值给root.pendingLanes。 commit阶段的最后重新发起调度。
整个流程始终以高优先级任务为重,顾全大局,最能够体现React提升用户体验的决心。
https://juejin.cn/post/7089034676735574029
Sorry, something went wrong.
No branches or pull requests
https://segmentfault.com/a/1190000041094886
The text was updated successfully, but these errors were encountered: