Chapter 5. React with JSX
In the last chapter, we dove deep into how React works, breaking down
our React applications into small reusable pieces called components. These components render trees of elements and other components. Using the
In this chapter, we’re going to discuss how to use JSX to construct a React application.
React Elements as JSX
Facebook’s React team released JSX when they released React to provide a concise syntax for creating complex DOM trees with attributes. They also hoped to make React more readable like HTML and XML. In JSX, an element’s type is specified with a tag. The tag’s attributes represent the properties. The element’s children can be added between the opening and closing tags.
You can also add other JSX elements as children. If you have an unordered list, you can add child ...