Explore how to set up a new ReactJS project and build a simple home page component with essential features. Great for beginners looking to understand the key steps of starting a React app.
Which command is used to create a new ReactJS application using create-react-app?
Explanation: The command 'create-react-app simple-react-homepage' correctly uses Create React App to set up a new project. 'react start simple-react-homepage' and 'yarn new react-app' are not valid commands for creating a React app. 'npm install react-homepage' installs a package but does not generate a project structure.
After creating a new ReactJS project, which files are commonly deleted when cleaning up the starter template?
Explanation: Removing 'App.css', 'App.test.js', 'logo.svg', and 'setupTests.js' helps clean up unused starter files. The other groups mention important files or files not part of the default template that should not be deleted.
What is the recommended folder to create inside 'src' for organizing a new HomePage component?
Explanation: 'components' is the best practice for storing and organizing React components like HomePage. 'styles' is used for CSS, 'assets' for images or icons, and 'helpers' for utility functions or logic.
How should the HomePage component be imported into App.js for use in the main application render?
Explanation: The correct ES6 import syntax is 'import HomePage from './components/HomePage';'. 'require' is for CommonJS and not typical in React, the third option omits the correct path, and the fourth uses named imports, which don't match a default export.
Which command starts the local development server and opens the app in a browser during development?
Explanation: 'npm start' will launch the development server and typically open the app in the browser. 'npm run build' builds the app for production without running a server, 'npm install' installs dependencies, and 'node start-app' is not a recognized npm script in this context.