Creating your own JSX elements
Components are the fundamental building blocks of React. In fact, components are the vocabulary of JSX markup. In this section, we'll see how to encapsulate HTML markup within a component. We'll build examples that nest custom JSX elements and learn how to namespace components.
Encapsulating HTML
We create new JSX elements so that we can encapsulate larger structures. This means that instead of having to type out complex markup, you can use your custom tag. The React component returns the JSX that goes where the tag is used. Let's look at the following example:
import * as React from "react"; import * as ReactDOM from "react-dom"; class MyComponent extends React.Component { render() { return ( <section> <h1>My Component</h1> ...