Create a React project in 60 seconds
We use Vite (pronounced “veet”) as the build tool. It’s fast, simple, and the recommended way to start React projects.http://localhost:5173. Every time you save a file, the browser updates instantly.
Vite is to JavaScript what FastAPI is to Python — the modern, fast, no-nonsense choice. It replaces the older Create React App (CRA), which is no longer recommended.
Project structure
The files that matter
index.html — The single HTML page. React renders everything into<div id="root">.
React.StrictMode is a development-only helper. It may render components (and run effects) more than once in development to help catch bugs. This can look surprising at first, but it does not happen in production builds.The .jsx extension
React files use.jsx instead of .js. JSX lets you write HTML-like syntax inside JavaScript — you’ll learn more in the next lesson.
.jsx and .js both work in Vite. The convention is .jsx for files that contain JSX (which is almost every React file). Some projects use .tsx for TypeScript + JSX.Key scripts
Yourpackage.json includes these scripts:
npm run dev.
Adding your first component
Create a new file insrc/:
App.jsx:
Organizing components
As your app grows, create folders to organize:What’s next?
Your project is running. Now let’s learn the core building blocks — components and JSX.Components and JSX
Build UI with reusable components using JSX syntax