...

/

Understanding How the Single Page Is Served

Understanding How the Single Page Is Served

Learn how the single page is served.

Understanding the structure of index.html in React app

We know that the single page that hosts the React app is index.html, so let’s examine this file. This file can be found in the public folder of the ClientApp folder. The React app will be injected into the div tag, which has an id of root:

Press + to interact
<div id="root"></div>

Let’s run our app again in Visual Studio to confirm that this is the case by pressing “F5.” If we open the developer tools in the browser page that opens and inspect the DOM in the “Elements” panel, we’ll see this div tag with the React content inside it:

Press + to interact
Root div element and script elements
Root div element and script elements

...