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

关于 Fiber 和 React Virtual DOM 的概念 #95

Open
AllenMinD opened this issue Jul 30, 2021 · 2 comments
Open

关于 Fiber 和 React Virtual DOM 的概念 #95

AllenMinD opened this issue Jul 30, 2021 · 2 comments

Comments

@AllenMinD
Copy link

在看卡老师的电子书的 render阶段章节https://kasong.gitee.io/just-react/process/fiber.html,发现有一处地方好像和官方文档https://reactjs.org/docs/faq-internals.html有点点不一样:

1、卡老师的书中提到:“虚拟DOM在React中有个正式的称呼——Fiber。 ...... 我们会逐渐用 Fiber 来取代 React 16 虚拟DOM 这一称呼”:

image

2、但是官方文档提到:React 的“虚拟DOM”的实现其实包含了 React Element 和 fiber 两者:

image

@BetaSu
Copy link
Owner

BetaSu commented Jul 30, 2021

这只是不同视角的理解, 实际上横向对比Vue和React, 源码层面 Fiber 和 VNode 就是 Virtual DOM的意思

@AllenMinD
Copy link
Author

这只是不同视角的理解, 实际上横向对比Vue和React, 源码层面 Fiber 和 VNode 就是 Virtual DOM的意思

明白了!感谢卡老师的回复~~

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