美文网首页
3.0 Rendering Elements 渲染元素

3.0 Rendering Elements 渲染元素

作者: 人头原子弹 | 来源:发表于2017-03-26 10:35 被阅读0次

    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.
    注意:
    人们可能将元素与更广为人知的“组件”概念混淆。我们将在下一节中介绍组件。组件是怎么由元素组成的,我们鼓励您在向前跳过之前阅读此部分。

    相关文章

      网友评论

          本文标题:3.0 Rendering Elements 渲染元素

          本文链接:https://www.haomeiwen.com/subject/jwrnnttx.html