Base Components

Learn how base components register and load the components used frequently in our application.

We'll cover the following

Overview

Base components usually consist of small components often used throughout an application. Typically, if we want to use a component, it has to be imported and then registered. What’s special about base components is that they’re imported and registered automatically for us. To make it work, we use Webpack’s require.context function, as explained below.

Let’s assume we have this directory structure:

Get hands-on with 1400+ tech skills courses.