0
0
Reactframework~5 mins

Creating first React app - Quick Revision & Summary

Choose your learning style9 modes available
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?
Anpm react create
Bnpm install react-app
Creact new app
Dnpx create-react-app my-app
Where does React render the app in the HTML file?
A<div id="root"></div>
B<body>
C<header>
D<main>
Which file is the main entry point for React components?
Asrc/index.js
Bpublic/index.html
Csrc/App.css
Dpackage.json
What command starts the React development server?
Anpm run dev
Bnpm start
Cnpm build
Dnpm serve
Which hook is used to add state in a React functional component?
AuseRef
BuseEffect
CuseState
DuseContext
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.