React Getting Started Guide
Subject: Web Development
š¹ 1. React Directly in HTML (For Learning / Demos)
This is the quickest way to start using React for learning purposes ā no installation required.
š¦ What You Need:
Just a browser and a text editor like VS Code.
šŖ Steps:
ā Step 1: Create an HTML File
Create a file called index.html
:
ā Step 2: Open in Browser
Just double-click the file or open with Live Server in VS Code.
š¹ 2. React for Production (Using Node.js + npm)
This is the recommended way for serious projects.
š¦ What You Need:
- Node.js (comes with npm)
- A terminal
- A code editor (like VS Code)
š Install Node.js
Go to: https://nodejs.org and install the LTS version.
Then check installation in your terminal:
āļø Option A: Using Vite (Fastest Modern Setup)
šŖ Steps:
ā Step 1: Create a Vite Project
ā Step 2: Install dependencies
ā Step 3: Start the development server
š¢ Open the browser and go to http://localhost:5173
āļø Option B: Using Create React App (CRA)
šŖ Steps:
ā Step 1: Create the app
ā Step 2: Start the development server
š¢ It will open automatically in the browser at http://localhost:3000
š§± Project Structure (CRA or Vite)
šÆ Summary: Which One Should You Use?
Method | Best For | Setup Time | Tools Needed |
---|---|---|---|
React in HTML (CDN) | Learning, small demos | ā±ļø Instant | None |
Vite | Modern apps, fast setup | ā” Fast | Node + npm |
Create React App | Traditional full setup | ā±ļø Medium | Node + npm |
Advertisement Slot 1
Advertisement Slot 2