Understanding the React frontend
It's time to turn our attention to the React frontend. In this section, 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
We have a good clue as to where the entry point is from our examination of the Startup
class in the ASP.NET Core backend. In the Configure
method, the SPA middleware is set up with the source path set to ClientApp
:
app.UseSpa(spa => { spa.Options.SourcePath = "ClientApp"; if (env.IsDevelopment...