web development / react
Learn React for Free: Pick Next.js, React Router or Vite, Then Learn the Core in Order
The first React decision is no longer "which course" but "which starting point." This guide compares Next.js, React Router and a plain Vite setup using the commands and requirements from their own docs, then teaches the fundamentals through a component that was run and tested.
React is a JavaScript library for building interfaces from components. The library itself is small. What overwhelms beginners is everything around it: routing, data loading, server rendering, build tools and the opinions of every tutorial author. The official React docs now say plainly that if you are building a new app or website, they recommend starting with a framework. That advice changes how a learner should start.
This page sorts the choices first, because a wrong start costs a week, and then covers the React concepts in the order that makes later ones easier. The version current on react.dev when this was checked is 19.3, released September 2026.
01 · CHOOSING A STARTING POINT
Next.js, React Router or Vite: how to decide
react.dev's page on creating a React app lists three recommended frameworks and a start-from-scratch route. All of the listed frameworks support client-side rendering, single-page apps and static-site generation, so none of them forces you to run a server. The real differences are what each one decides for you.
| Starting point | Command | Requirement | It decides for you | Pick it when |
|---|---|---|---|---|
| Next.js (App Router) | npx create-next-app@latest | Node.js 20.9 or newer | Routing, rendering, bundler. Default setup enables TypeScript, Tailwind CSS, ESLint, App Router and Turbopack | You want a full-stack app, server rendering or a job-market skill |
| React Router v7 | npx create-react-router@latest | See its install guide | Routing and a Vite-based full-stack setup | You want routing-first structure with fewer defaults |
| Vite with React | npm create vite@latest | Node.js 20.19+ or 22.12+ | Almost nothing: you choose routing and data fetching | You are learning core React and want the least hidden |
| Expo | npx create-expo-app@latest | See Expo docs | Native Android and iOS plus web | You are building a mobile app |
react.dev says building from scratch with Vite, Parcel or Rsbuild requires you to choose tools for routing, data fetching and other common patterns. That is the cost and also the benefit for a learner: you see every piece. A good middle path is to learn the fundamentals in a Vite project, then rebuild one small app in Next.js to see what a framework adds.
react template gives plain JavaScript and react-ts gives TypeScript. Learning React and TypeScript together doubles the error messages.node --version before the scaffolding command and compare it to the requirement above.02 · THE CORE
The fundamentals in the order that works
These five ideas are most of what you need to read any React codebase. Do them in order, because each one uses the one before.
| Order | Concept | You understand it when you can... |
|---|---|---|
| 1 | Components and JSX | Split a screen into components and explain why a component name starts with a capital letter |
| 2 | Props | Pass data into a component and explain why a component should not change its own props |
| 3 | State | Explain why changing a variable does not update the screen but calling a setter does |
| 4 | Thinking in React | Break a mockup into a component tree and decide where state should live |
| 5 | Effects | Tell whether a piece of logic needs an effect or can run during rendering |
The first three are covered by react.dev's Learn section, which starts with the Quick Start. After that, read "Thinking in React" and "Choosing the State Structure" before building anything bigger than a to-do list. Most state bugs in beginner projects are structure problems that those two pages address.
03 · A WORKED EXAMPLE
Derived state: filter a list without a second useState
The most common beginner mistake is storing something in state that could be calculated. Here, the list of visible trails is not state. It is computed from the query on every render, so it can never fall out of sync.
import { useState } from 'react';
const TRAILS = ['Ridge loop', 'River path', 'Summit spur'];
export default function TrailList() {
const [query, setQuery] = useState('');
// derived from state on every render: no second useState needed
const visible = TRAILS.filter((t) => t.toLowerCase().includes(query.toLowerCase()));
return (
<>
<label>
Search <input value={query} onChange={(e) => setQuery(e.target.value)} />
</label>
<ul>
{visible.map((t) => (
<li key={t}>{t}</li>
))}
</ul>
<p>{visible.length} of {TRAILS.length} shown</p>
</>
);
}This was bundled with esbuild against React 19.3.1 and loaded in Chromium. It starts at "3 of 3 shown". Typing ri leaves Ridge loop and River path with "2 of 3 shown", and typing zzz shows no items and "0 of 3 shown". There were no console errors. The key on each list item is the trail name, which is unique here; use a stable id from your data in a real app instead of the array index.
Try breaking it on purpose. Add a second useState for visible and update it inside onChange. It appears to work, then fails the moment the source list changes, because the two values can drift apart.
04 · EFFECTS
Most of what people write in useEffect does not need to be there
Effects exist to synchronize a component with something outside React, such as a network request or a browser API. They are not for calculating values from props and state, and beginners overuse them. react.dev has a dedicated page called "You Might Not Need an Effect," and reading it early saves a lot of re-render loops. A good test: if you can compute it during rendering, do not use an effect.
05 · FREE RESOURCES
The pages and courses to use
- React: Quick Start ↗The official starting point for learning React.react.dev
- React: Tic-Tac-Toe tutorial ↗An official hands-on project you build step by step.react.dev
- React: State, a component's memory ↗The page that explains why state exists and how it differs from a variable.react.dev
- React: Thinking in React ↗How to break a design into components and place state.react.dev
- React: Choosing the state structure ↗Principles for state that stays consistent.react.dev
- React: You might not need an effect ↗When to avoid effects, with before and after examples.react.dev
- React: Creating a React app ↗The official comparison of frameworks and the build-from-scratch option.react.dev
- Learn Next.js ↗The official course for the Next.js framework.nextjs.org
- React Router: installation ↗Setup for React Router as a framework.reactrouter.com
- Vite: getting started ↗Requirements and the scaffolding command for the plain-React route.vite.dev
- MDN: getting started with React ↗A framework-neutral tutorial from MDN that sets up a project and builds a to-do app.developer.mozilla.org
- The Odin Project: React ↗A free project-based React course that assumes JavaScript fundamentals.theodinproject.com
- roadmap.sh React roadmap ↗A visual map of topics to return to once the basics are solid.roadmap.sh
06 · FAQ
Frequently asked questions
Should I learn React with Next.js or Vite?
React's docs recommend starting new apps with a framework such as Next.js or React Router. For learning the core concepts, a plain Vite project hides less. A practical path is to learn the fundamentals with Vite, then rebuild one small app in Next.js.
Do I need to know JavaScript before learning React?
Yes. React is a JavaScript library, so you should be comfortable with functions, array methods like map and filter, destructuring and modules first. Shaky JavaScript is the main reason beginners find React confusing.
Is React free?
Yes. The official docs, tutorial and Learn section at react.dev cost nothing. The Next.js course, the React Router docs and the Vite guide linked on this page are free to read too.
What is the latest version of React?
React 19.3, released in September 2026, was the latest version listed on react.dev when this page was checked. Check the versions page for newer releases.
Is Create React App still the way to start?
The current React docs do not list it. They recommend a framework such as Next.js, React Router or Expo, or a build tool such as Vite, Parcel or Rsbuild if you start from scratch.