React Getting Started
๐ React โ Getting Started
To start working with React, you need to set up an environment where React code can run. You can get started in three ways:
โ 1. Using CDN (Quick Testing โ No Installation)
Good for beginners who just want to experiment.
โ 2. Using Create React App (Beginner-Friendly Setup)
This creates a fully ready development environment.
โ Step 1: Install Node.js
If not installed, download from: https://nodejs.org
Check installation:
โ Step 2: Create Project
โ Step 3: Run Project
Your browser opens at:
๐ http://localhost:3000
โ 3. Using Vite (Fastest & Modern Method)
Best for performance and modern development.
โ Step 1: Create a Vite React app
โ Step 2: Install dependencies
โ Step 3: Run the project
Vite will give a local link like:
๐ http://localhost:5173
๐ Project Structure (Common in React Apps)
Important files:
| File | Purpose |
|---|---|
App.jsx |
Main UI component |
index.js / main.jsx |
Entry point of React app |
public/index.html |
HTML shell file |
๐งช First React Component Example
Edit src/App.jsx:
React will automatically refresh the page.
๐ You’re Ready!
Now you understand:
โ React setup options
โ How to install
โ How to run a project
โ First working component
