React and Next.js are not alternatives. React is a library for building user interfaces out of components, and it deliberately does nothing else: no routing, no server, no build configuration. Next.js is a framework built on top of React that supplies those missing pieces with strong opinions about how they fit together. Every Next.js application is a React application. The question is whether you want React on its own with tools you choose, or React inside Next.js with the decisions made for you.
What React is#
A way to describe a user interface as a tree of components, and to keep the screen in sync with data as it changes. That is all. To turn that into a website you also need a way to serve the page, a build step to bundle the JavaScript, and, for anything with more than one page, a router. React leaves those to you, which is why “create a React app” has always meant picking a set of tools.
function Greeting({ name }) {
return <h1>Hello, {name}</h1>;
}
That component is identical in plain React and in Next.js.
What Next.js adds#
- Routing from the file system. A file at
app/about/page.jsis the/aboutpage. Nested folders are nested routes; dynamic segments are folders named[id]. - Rendering on the server. Pages can be rendered to HTML on the server per request, at build time, or in the browser, per page. Plain React renders in the browser unless you set up server rendering yourself.
- Data fetching where it belongs. Server components can fetch data directly, with no client-side loading state and no API round trip.
- A build and dev server, preconfigured, with fast refresh, code splitting, image optimisation and font handling.
- API routes. Backend endpoints in the same project, under
app/api. - Deployment conventions that hosting platforms understand without configuration.
What plain React with Vite gives you#
Vite is the usual way to start a React project without Next.js: a fast dev server and build with minimal configuration. You add a router (React Router is the common choice), decide how to fetch data, and get a single-page application that renders in the browser. It is simpler to understand, because there is only one place code runs, and it is the right shape for applications that live behind a login, where search engines and first-paint speed matter less.
| React with Vite | Next.js | |
|---|---|---|
| Routing | Add a library | Built in, from files |
| Where components render | Browser | Server, build time, or browser, per page |
| Data fetching | In the browser, after load | On the server, before the HTML is sent |
| Search-engine friendliness | Needs extra work | Default |
| Backend endpoints | Separate project | API routes in the same project |
| Learning curve | React only | React plus the framework’s conventions |
| Best for | Dashboards, internal tools, apps behind login | Content sites, e-commerce, anything public |
Server components: where the code runs#
The largest conceptual difference in current Next.js. By default, components in the app directory are server components: they run on the server, can read databases and files directly, and send HTML to the browser with no JavaScript for themselves. A component that needs interactivity — state, effects, event handlers — is marked with 'use client' and runs in the browser.
// app/posts/page.js - a server component: runs on the server, no client JS
import { db } from '../lib/db';
export default async function Posts() {
const posts = await db.post.findMany();
return <ul>{posts.map(p => <li key={p.id}>{p.title}</li>)}</ul>;
}
// app/posts/LikeButton.js - a client component
'use client';
import { useState } from 'react';
export default function LikeButton() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>{count}</button>;
}
In plain React everything is a client component, always. The server-component model is powerful and it is a second thing to learn; it is the main reason Next.js has a steeper curve.
Which to learn first#
React. Next.js assumes you know components, props, state and effects, and its own conventions on top of those are confusing when you are still learning what a component is. Spend a few weeks in plain React with Vite, build two or three things, then move to Next.js when you want routing and server rendering. What you learned transfers entirely.
Which to use for a project#
- A public website, blog, marketing site, shop: Next.js. Server rendering, image handling and routing are exactly its strengths.
- An internal tool or dashboard behind a login: plain React with Vite is enough and simpler.
- A prototype to try an idea: whichever you know better.
- A team already on one: stay on it.
Questions people ask#
Is Next.js made by the React team?
No. React is maintained by Meta; Next.js by Vercel. The two teams collaborate closely, and Next.js is where several React features first became usable.
Can I use Next.js without server rendering?
Yes: static export produces plain HTML and JavaScript for any static host, and client components can do everything plain React does.
What about Remix, Astro, or Vite alone?
Remix and React Router’s framework mode are alternatives to Next.js with similar goals. Astro is for content sites and can embed React components. All are React underneath.
Does Next.js replace a backend?
For small applications, API routes and server components can be the whole backend. For larger systems, they usually sit in front of a separate service.
Where to go next#
- React hooks explained — the React you need first.
- Next.js vs Vite — the tooling decision in detail.
- Introduction to JavaScript frameworks — the wider landscape.