Catalog
  1. 1. React 中 Element 与 Component分别是什么
  2. 2. 它们有什么区别
  3. 3. 推荐阅读
React 中 Element 与 Component 的区别?

React 中 Element 与 Component分别是什么

  • React Element 是 React 实现界面内容的最小单元
  • React Component 是由React Element 构成的小的代码片段

它们有什么区别

  • 一个是元素,一个是组件
  • Element具体描述了你在屏幕上想看到的内容,而Component则是将这些内容根据不同的逻辑分组得到的代码片段

推荐阅读

Author: Erealm
Link: http://erealmsoft.github.io/2019/09/23/react/react-element-and-Component/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.

Comment