jsx里嵌套jsx
JSX allows us to add HTML elements in React, thus making it easier to write React components in an efficient and expressive manner. In this blog I will briefly explain what JSX is, then I will focus on explaining some of the unique syntax of JSX.
JSX允许我们在React中添加HTML元素,从而使以有效和富有表现力的方式编写React组件变得更加容易。 在此博客中,我将简要说明什么是JSX,然后将重点介绍一些JSX的独特语法。
什么是JSX? (What is JSX?)
JSX stands for JavaScript XML. It is a syntax extension for JavaScript that was written to be used in React applications. JSX code looks a lot like HTML but it comes with the full power of JavaScript. With JSX we can write HTML elements in JavaScript without using methods like createElement() or appendChild(). JSX converts HTML tags into React elements.
JSX代表JavaScript XML。 这是用于React应用程序JavaScript语法扩展。 JSX代码看起来很像HTML,但是它具有JavaScript的全部功能。 使用JSX,我们可以使用JavaScript编写HTML元素,而无需使用诸如createElement()或appendChild()之类的方法。 JSX将HTML标签转换为React元素。
JSX is considered as a declarative style of programming, whereas most of the JavaScript code w