Creating a root web page

We need an HTML page that is going to host our React app. Create a file called index.html in our dist folder, and enter the following:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<div id="root"></div>
<script src="bundle.js"></script>
</body>
</html>

The HTML from our React app will be injected into the div with id ="root". All the app's JavaScript code will eventually be bundled together into a file called bundle.js in the dist folder.

Of course, neither of these exist at the moment—we'll do this in a later section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.204.208