2.0 Introducing JSX 介绍JSX

2017-03-12  本文已影响0人  人头原子弹

Consider this variable declaration:

考虑这个变量声明:

const element = <h1>Hello World!</h1>

This funny tag syntax is neither a string nor HTML.

这个搞笑的标签语法既不是字符串也不是HTML。

It is called JSX, and it is a syntax extension to JavaScript. We recommend using it with React to describe what the UI should look like. JSX may remind you of a template language, but it comes with the full power of JavaScript.

它被叫着JSX。它是JavaScript的语法扩展。我们建议使用它来描述UI的样子。你也许会认为JSX是个模板语言,但是它却拥有JavaScript的全部能力。

上一篇 下一篇

猜你喜欢

热点阅读