Elements are the smallest building blocks of React apps.
元素是构建React应用的最小块。
An element describes what you want to see on the screen:
一个元素描述你想在屏幕上展示什么:
const element = <h1>Hello, world</h1>;
Unlike browser DOM elements, React elements are plain objects, and are cheap to create. React DOM takes care of updating the DOM to match the React elements.
不像浏览器的DOM元素,React元素是纯粹的对象,并且方便创建。React DOM 专注于更新DOM以匹配React元素。
Note:
One might confuse elements with a more widely known concept of "components". We will introduce components in the next section. Elements are what components are "made of", and we encourage you to read this section before jumping ahead.
注意:
人们可能将元素与更广为人知的“组件”概念混淆。我们将在下一节中介绍组件。组件是怎么由元素组成的,我们鼓励您在向前跳过之前阅读此部分。
网友评论