This code will serve as our starting point for exploring the basics of React.
Note that this project was bootstrapped with Create React App, which is a tool we'll explore later in the course for (as the name implies) creating a React app. Because the project was bootstrapped with Create React App, there's some stuff here that you don't need to worry about yet. For now, we'll focus our development on the file src/index.js.
The first time you run this app, make sure to run npm install
first, to install needed dependencies. Then, to run the app and see it in your browser, you can run
npm start
This will run the app in the development mode, and it should automatically open http://localhost:3000 to view the app in your browser (though you can manually open that URL in your browser, too). The app is set up so that the page will reload if you make edits to the code. You will also see any lint errors in the console.