Component Composition: Multiple Components in One

Learn about components and the various forms through which components can be returned.

So far, we have only really included DOM elements in our example components. However, React components can also include other nested React components. By defining the component in the same scope or by using CommonJS or the ES-Modules imports withrequire() or import, we can use multiple components in the same scope.

Let’s look at an example to illustrate this:

Get hands-on with 1400+ tech skills courses.