How to Build a React App from Scratch with Vite (2026)
Spin up a real React app in under a minute with Vite, then learn what every generated file does and how to build your first component.
Why Vite instead of Create React App
Step 1: Create the project
Step 2: Install and run
Step 3: Understand the files
Step 4: Build your first component
Step 5: Add state with useState
Scrimba
Want to learn React by writing code?
Scrimba's React course lets you pause the video and edit the instructor's code right in the lesson. It's an interactive way to build on your first Vite app and get comfortable with components, props, and state. Free to start.
Learn React on ScrimbaThis is an affiliate link. We may earn a commission if you sign up, at no extra cost to you. We only recommend platforms we rate.
Frequently Asked Questions
Is Vite better than Create React App?
Yes, and Create React App is now retired. Vite starts faster, reloads changes almost instantly, and builds smaller bundles. It's the current standard for new React projects, so there's no reason to start a new app with the old tool.
Do I need to know JavaScript before learning React?
You should be comfortable with JavaScript basics first: functions, arrays, objects, and array methods like map. React is a JavaScript library, so gaps in the language show up quickly. If you're shaky, spend a few weeks on JavaScript, then start React.
What is JSX?
JSX is the HTML-like syntax you write inside React components, such as <h1>Hello</h1> sitting in a JavaScript function. It's not really HTML; a build step turns it into function calls. In practice you write it like HTML with JavaScript values dropped in using curly braces.
Why does my React app show a blank page?
The most common causes are a JavaScript error (check the browser console), forgetting to export default your App component, or a typo in a component name. React component names must start with a capital letter, so greeting won't render but Greeting will.
Recommended Courses
Scrimba's interactive React course teaches components, state, props, hooks, effects, and routing. Build a travel journal, color scheme generator, and meme generator. The interactivity sets it apart.
The Odin Project's dedicated React curriculum. Covers components, JSX, state, effects, routing with React Router, testing, and performance. Build a full series of projects including a shopping cart application.