Loading

Quipoin Menu

Learn • Practice • Grow

react / Create React App Setup
interview

Q1. What is Create React App?
Create React App (CRA) is an officially supported tool for setting up a new React project with zero configuration. It provides a modern build setup with Webpack, Babel, ESLint, and other tools, allowing developers to focus on writing code without worrying about build configurations.

Q2. How do you create a new React app using Create React App?
You can create a new app by running the command: npx create-react-app my-app (where my-app is the project name). This will create a folder with all the necessary files and dependencies. Then navigate into the folder and run npm start to start the development server.

Q3. What are the main scripts available in a Create React App project?
The main scripts are: npm start (starts development server), npm run build (creates an optimized production build), npm test (runs tests), and npm run eject (ejects the configuration for full control, which is irreversible).

Q4. What is the purpose of the public folder in CRA?
The public folder contains static assets like index.html, images, and other files that are not processed by Webpack. Files placed here are copied as-is to the build folder. It is also where you can add a manifest.json for progressive web apps and other static resources.

Q5. Can you customize the Webpack configuration in Create React App without ejecting?
Yes, you can customize some aspects by using tools like react-app-rewired or CRACO (Create React App Configuration Override). These allow you to override Webpack settings without ejecting. Alternatively, you can use environment variables to modify behavior.