Recall & Review
beginner
What command do you use to create a new React app using the official tool?
You use
npx create-react-app my-app to create a new React app named 'my-app'.Click to reveal answer
beginner
What is the main file where React components start rendering in a new React app?
The main file is
src/index.js. It renders the root React component into the HTML page.Click to reveal answer
beginner
Which React hook is commonly used to add state to a functional component?
The
useState hook lets you add state to functional components.Click to reveal answer
beginner
How do you start the React development server to see your app in the browser?
Run
npm start inside your React app folder to start the development server.Click to reveal answer
beginner
What file contains the HTML structure that React renders into?
The
public/index.html file contains the HTML where React inserts the app.Click to reveal answer
Which command creates a new React app?
✗ Incorrect
The correct command is
npx create-react-app my-app to create a new React app.Where does React render the app in the HTML file?
✗ Incorrect
React renders the app inside the
<div id="root"></div> element.Which file is the main entry point for React components?
✗ Incorrect
The main entry point is
src/index.js, where React starts rendering.What command starts the React development server?
✗ Incorrect
Use
npm start to launch the React development server.Which hook is used to add state in a React functional component?
✗ Incorrect
useState is the hook to add state inside functional components.Describe the steps to create and run your first React app from scratch.
Think about commands and what happens after creating the app.
You got /4 concepts.
Explain the role of the 'src/index.js' and 'public/index.html' files in a React app.
One is HTML, the other is JavaScript starting point.
You got /3 concepts.