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

React Fiber 相对于虚拟 DOM 的树结构有什么优势 #57

Open
nmsn opened this issue May 18, 2023 · 1 comment
Open

React Fiber 相对于虚拟 DOM 的树结构有什么优势 #57

nmsn opened this issue May 18, 2023 · 1 comment
Labels

Comments

@nmsn
Copy link
Contributor

nmsn commented May 18, 2023

如题

@nmsn nmsn added the React label May 18, 2023
@nmsn
Copy link
Contributor Author

nmsn commented May 18, 2023

在树结构的时代,页面触发了更新,在 react 中会递归整个页面的树后进行更新,如果存在大量更新,或者更新逻辑复杂,会占用大量时间和资源,会导致卡顿

在树的结构中,每个节点只会存它自己的信息以及 children 的信息
这种情况下,执行是不能进行回溯的(也就是回到父节点)
所以只能继续执行下去,如果在这个过程中,有新的更新,那也只能在这一次更新结束后,再执行下一次更新

@nmsn nmsn changed the title React Fiber 相对于虚拟 DOM 的数结构有什么优势 React Fiber 相对于虚拟 DOM 的树结构有什么优势 Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant