In the preceding section, we learned how to use the render method from the react-dom module to render the Layout component. In this section, we are going to take a closer look at the Layout component.
As we can see in the code snippet below, the Layout component is a function that returns a series of nested JSX elements; some of these JSX elements are other React components (such as BrowserRouter, Header, and Switch components). This is the first time that we have seen the actual implementation of a React component. In this case, a React component is a function that returns some JSX. However, it is important to mention that this is not always the case as a component can also be a class.
React is a component-based ...