Frontend Foundations

React vs Next.js

They're often mentioned in the same breath — but one is a library and the other is a framework built on top of it. Here's what actually separates them.

React

A JavaScript library for building user interfaces

React gives you components and a way to render them. It's unopinionated about everything else — routing, data fetching, bundling, and how you serve your app are all up to you (or other libraries you choose).

The one-sentence version

If React is the engine, Next.js is the whole car built around that engine.

⚙️

React

A powerful engine. Flexible, but you assemble the rest yourself.

🚗

Next.js

The engine plus chassis, wheels, and dashboard — ready to drive.

Side by side

The same React engine sits underneath, but Next.js makes decisions for you that React leaves open.

AspectReactNext.js
What it isUI libraryFull-stack React framework
RoutingNot included — add React Router or similarBuilt in (file-based routing)
RenderingClient-side by defaultSSR, SSG, ISR & client — your choice per page
Backend / APIsNone — you build a separate serverAPI routes & server functions included
SetupPick your own bundler & configZero-config out of the box
SEOWeaker (content renders in browser)Strong (HTML rendered on the server)
Performance toolingManualImage, font & script optimization built in
Learning curveLower — fewer conceptsHigher — more conventions to learn

What Next.js adds on top

Everything React does, plus the parts you'd otherwise stitch together yourself.

React gives you

  • Components & JSX
  • State and props
  • Hooks (useState, useEffect…)
  • The virtual DOM & efficient re-renders
  • A rich ecosystem to plug into

Next.js layers on

  • File-based routing
  • Server-side & static rendering
  • API routes / server actions
  • Automatic code splitting & bundling
  • Image, font & SEO optimization
  • Easy deployment defaults

Routing in practice

A simple example of the biggest day-to-day difference: how you define a page.

React + React Router

// you wire routes up by hand
import { BrowserRouter, Route } from 'react-router-dom'

<BrowserRouter>
  <Route path="/about" element={<About/>}/>
</BrowserRouter>

Next.js

// the file IS the route
// app/about/page.js

export default function About() {
  return <h1>About</h1>
}

// → automatically served at /about

When to reach for which

Neither is "better" — they fit different jobs.

Choose React when…

You're adding interactive UI to an existing app or page.

You're building a single-page app where SEO doesn't matter much (internal dashboards, tools).

You want maximum control over your stack and tooling.

You're learning fundamentals and want fewer moving parts.

Choose Next.js when…

You're building a complete website or product from scratch.

SEO and fast first-page loads matter (marketing sites, e-commerce, blogs).

You want frontend and backend (API routes) in one project.

You'd rather use proven defaults than configure everything yourself.

The key takeaway: Next.js isn't a competitor to React — it uses React. Every Next.js app is a React app. The question isn't "React or Next.js," it's "plain React, or React with the framework that handles routing, rendering, and the backend for me?"