Start a React project
Create a React project with Vite
Scaffold a small local project for learning React fundamentals without relying on the deprecated Create React App tool.
Create a small Vite project so we can focus on React itself:
npm create vite@latest react-basics -- --template react
cd react-basics
npm install
npm run dev
Open the local URL printed by Vite. Keep the terminal running while you edit.
The generated project gives the browser normal HTML, JavaScript modules, and CSS. Vite transforms JSX during development and creates optimized assets for production. React still runs in the browser; Vite is the toolchain around it.
Delete the demo content from src/App.jsx and start with this:
export default function App() {
return <h1>React basics</h1>
}
Save the file and confirm the page updates.
This setup is good for learning the library directly. For a production application, a framework can also decide how routing, data loading, server rendering, and deployment work. Choose that architecture from the product’s needs rather than treating a bare Vite app as the answer to every React project.
If the page does not load, read the first terminal error before changing code. A missing dependency, wrong directory, and JSX syntax error need different fixes.
Lesson completed