How to Create a React App in VS Code
1. Prerequisites
- Install Node.js and npm from https://nodejs.org/
- Install Visual Studio Code from https://code.visualstudio.com/
- (Optional) Install ES7+ React/Redux snippets extension in VS Code
- Verify installation:
node -v
npm -v
2. Open VS Code Terminal
- Open VS Code
- Open Terminal via Ctrl + ` or Terminal > New Terminal
3. Create React App
- Run the following command:
npx create-react-app my-app
- Replace 'my-app' with your desired project name
4. Navigate to Your App Directory
- cd my-app
5. Start the React App
- Run:
npm start
- This will open http://localhost:3000/ in your browser
6. Open Project in VS Code
- If you're not already in VS Code, use:
code my-app
7. Start Building
- Modify src/App.js to begin developing your React app
React App Folder Structure Overview
- public/: Static files (like index.html)
- src/: Source code (components, styles, etc.)
- package.json: Project configuration
- node_modules/: Installed dependencies
Optional: Install Additional Packages
- Example commands:
npm install react-router-dom # For routing
npm install axios # For HTTP requests
npm install tailwindcss # For styling