Printing and PDF export are disabled for this content. View it online at Full Stack Learning Simplified.
React Setup with Vite
The quickest way to start a React project today is Vite β a fast build tool with instant hot-reload. It scaffolds a project and dev server in seconds.
Create a project
bash
npm create vite@latest my-app -- --template react
cd my-app
npm install
npm run devThe dev server runs at http://localhost:5173 with hot module replacement β edits appear instantly without a full reload.
Project structure
project
my-app/
ββ index.html # the single HTML page
ββ src/
β ββ main.jsx # entry point (mounts React)
β ββ App.jsx # your root component
β ββ components/ # your components
ββ package.jsonThe entry point
main.jsx
// src/main.jsx
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.jsx";
createRoot(document.getElementById("root")).render(
<StrictMode><App /></StrictMode>
);Scripts
bash
npm run dev # development server
npm run build # production build -> dist/
npm run preview # preview the production buildWarning: Create React App is deprecated β don't use it for new projects. Use Vite for a single-page app, or a framework like Next.js when you want routing, SSR, and more built in.
Tip:
StrictMode (wrapping your app above) intentionally double-invokes some functions in development to surface bugs β it's a helper, and doesn't run in production.Free preview. Sign in and subscribe to unlock all 809 lessons across 25 courses.
Free preview Β· Β© 2026 Full Stack Learning Simplified