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

reactComponent和reactElement的区别 #29

Open
LeeeeeeM opened this issue Mar 27, 2019 · 1 comment
Open

reactComponent和reactElement的区别 #29

LeeeeeeM opened this issue Mar 27, 2019 · 1 comment

Comments

@LeeeeeeM
Copy link
Owner

LeeeeeeM commented Mar 27, 2019

component对应的是组件类这个概念,每一个自定义的react组件都是一个reactComponent类,对应的vueComponent,存储model。而reactElement对应的是一个element的概念,这个类更多的是指react树结构。此外,react中还有一个_renderedComponent其中对应的_currentElement是一个将react树解析成原生标签的结构,这一层是做dom diff的关键。

@LeeeeeeM
Copy link
Owner Author

LeeeeeeM commented Mar 28, 2019

image
一个是解析成原生标签树一个是组件

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

1 participant