Understanding the React Frontend
Learn to inspect the React frontend code.
We'll cover the following
It’s time to turn our attention to the React frontend. In this chapter, we’ll inspect the frontend code, starting with the entry point, which is a single HTML page. We will explore how the frontend is executed in development mode and how it is built in preparation for deployment. We will then learn how the frontend dependencies are managed and also understand why it took over a minute to run the app for the first time. Finally, we will explore how React components fit together and how they access the ASP. NET Core backend.
Understanding the frontend entry point
In a typical .NET frontend application, such as an ASP.NET Core web application, the Program.cs
file is responsible for configuring and starting the application.
If we look in the ClientApp
folder, we’ll see a file called package.json
. This is a file that is often used in React apps and contains information about the project, its npm dependencies, and the scripts that can be run to perform tasks.
Press the “Run” button to see the output.