Why do I need .gitignore in a React project?
To exclude node_modules and other generated files from Git. node_modules is large and reproducible from package.json, so committing it bloats the repository and causes avoidable merge conflicts.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in From Episode 1 to Episode 2: Setting Up Your Real React App
Install Node.js, initialize a project with package.json, install react and react-dom, add a bundler like Parcel as a devDependency, create an index.html and JavaScript entry, and mount your app with createRoot.
Install Node.js LTS first and verify npm works. Then initialize the project to create package.json. After that, install react and react-dom as dependencies and add a bundler as a devDependency.
No. That is too much at once. Get the app running first with React, ReactDOM, and a bundler. Add styling, linting, testing, and routing only when later episodes introduce them.
Still have questions?
Browse all our FAQs or reach out to our support team
