Next.js vs React: Framework or library for your project

startup business, software developer working on computer at modern office-3

React is a UI library and Next.js is a full-stack framework built on React, so you need to decide whether your project needs a framework and which rendering model fits it. Public, search-driven pages usually need server-rendered HTML; authenticated dashboards usually do not.

This comparison covers rendering, routing, data fetching, performance, operating cost and alternatives for engineers who already know SPAs and hydration. The answer depends on who consumes the page, where your data lives and what your team can host and secure.

Next.js vs React: The short answer and side-by-side table

Next.js vs React is a comparison between a framework and the library underneath it: React renders UI, and Next.js adds routing, server rendering and a backend layer on top. The decision is whether your project needs those server features.

Netguru builds web products and React and Next.js applications for enterprise and scale-up clients. We recommend Next.js with the App Router and React Server Components when public pages must rank, because the server sends finished HTML.

Client-side rendering with Vite fits apps behind a login, embedded widgets, and teams that already run a backend. For React basics, see what is React. If your public pages need to rank, our Next.js development specialists can help you choose the right rendering model for each route.

The differences side by side:

Attribute React (with Vite) Next.js (App Router)
What it is UI library Full-stack framework built on React
Routing None built in; add React Router or TanStack Router File-system routing with nested layouts
Rendering Client-side rendering by default Server-side rendering, static generation, incremental static regeneration and React Server Components, chosen per route
Data fetching Client fetch in effects or a library such as TanStack Query Async Server Components, Server Actions, Route Handlers
Backend capability None; you bring your own API Route Handlers and Server Actions cover light backend work, not a full replacement for a service layer
Build tooling Vite, which you configure and extend Turbopack, bundled with the framework
Deployment Static files on any CDN or static host Node runtime or a compatible host for server features; static export is possible without them
Learning curve Smaller core, but you assemble routing, data and rendering choices Larger surface: server/client boundary, caching and rendering modes

The deployment row is where most surprises appear. A Next.js app that uses server features will not run on a plain static host, so the hosting decision belongs in the first architecture conversation. Teams scoping a build can look at our React development and web development services.

Is Next.js the same as React?

No, Next.js is not the same as React. Next.js is a framework built on React: it imports the library and adds layers around it, and every page is still written as React components.

As of 9 November 2026, the current releases are React 19.3 (19.3.1 on npm) and Next.js 16.4 (16.4.5 on npm). Next.js adds file-based routing, Turbopack bundling, server rendering, and Route Handlers for backend endpoints. A plain React setup with Vite ships none of these.

React Server Components are a React feature, but React cannot run them alone: they need a bundler and a server that implement the protocol. The Next.js App Router is the best-known production implementation. React Router and TanStack Start are other frameworks built on React.

Our decision rule: because Next.js sits on top of React, the question is whether you need the framework layer. Choose Next.js if either of these conditions holds:

  • Pages must be server-rendered or indexed by search engines.
  • Routing, data fetching, and backend endpoints should live in one codebase.

If neither holds, choose React with Vite. Typical fits are a dashboard behind a login that calls an existing API, an embedded widget, or a client-only prototype.

A Vite project may be outgrowing plain React when you start hand-wiring a router, adding a separate server to pre-render pages, or building a proxy to hide API keys. Those are the jobs the framework layer handles.

CSR, SSR, SSG, ISR and React Server Components: When each fits

Choose a rendering model by data freshness, personalization, crawlability and build time: client-side rendering (CSR), server-side rendering (SSR), static site generation (SSG), incremental static regeneration (ISR) and React Server Components (RSC) each trade one of these against another.

Hub and spoke diagram with a per-route rendering choice at the center, surrounded by five models: CSR, SSR, SSG, ISR and RSC, each with where it fits.

The models side by side:

Model Where HTML is produced Fits Breaks down when
CSR In the browser, after the JavaScript bundle loads Dashboards behind a login, embedded widgets, a Vite single-page app Crawlability matters, or first paint on slow devices is a target
SSR On the server for each request, then hydration attaches event handlers Personalized or fast-changing pages that must be indexable Every request costs server compute and waits on its data
SSG At build time, leaving a fully static page Docs, marketing pages, public data that can be cached Build time grows with page count; content stays stale until the next deploy
ISR Static page, regenerated in the background after a set interval Large catalogs, news archives Data must be fresh per user or to the second
RSC Components run only on the server and send no component JavaScript to the client Data-heavy UI that fetches next to the component that renders it You cannot run a server runtime, or cannot absorb the added attack surface

SSR fetches and renders at request time. SSG fetches at build time, which suits data that is publicly cacheable or pre-rendered for SEO. ISR sits between them: in the Next.js App Router, one line sets the refresh interval for a route.

// app/products/[id]/page.tsx
export const revalidate = 3600; // regenerate at most once an hour

SSR and SSG pages still ship JavaScript to hydrate. Server Components, the App Router default, cut that cost for components that need no interactivity, and you opt into the browser with a 'use client' boundary.

The rules we apply: public and rarely changing means SSG, public with a large catalog means ISR, per-user and indexable means SSR, and per-user behind a login means CSR. Models mix per route, so a store can use SSG for category pages and CSR for the account area.

Plain React with Vite only gives you CSR. React Router and TanStack Start add server rendering, so a React development team can adopt SSR without Next.js, though with fewer built-in caching options.

Is plain React bad for SEO?

Plain React with Vite is weak for SEO on public pages: client-side rendering sends an empty HTML shell, and content appears only after JavaScript runs.

Pipeline diagram of a Vite SPA request in four stages: an empty HTML shell, the JavaScript bundle download and parse, the data fetch, and finally content paint, a chain that delays Largest Contentful Paint.

A quick test is to request the page without a browser, with a command-line HTTP client or by viewing the raw page source. A Vite SPA returns a body that holds one empty root element and a single module script tag pointing at the JavaScript bundle, with none of the page's text.

Three things follow from that empty shell:

  • Crawlability: Googlebot can execute JavaScript, but rendering is a separate, deferred step. Link-preview bots and some third-party crawlers may not run it at all.
  • Metadata: Titles, descriptions and Open Graph tags set client-side are missing from the first response.
  • First paint: The browser downloads and parses the bundle, then fetches data, and only then paints content. That chain delays Largest Contentful Paint, one of the Core Web Vitals defined on web.dev.

"React can do server-side rendering" is true, since react-dom/server turns components into HTML, but a Vite app stays client-rendered until someone builds that server layer. Hand-rolling server-side rendering means building server routing, loading data before render, splitting bundles per route, and keeping server markup identical to what hydration expects on the client.

Frameworks ship those pieces as defaults: the Next.js App Router, React Router in framework mode, and TanStack Start. For dashboards behind a login, none of this matters, and a Vite SPA remains a sound choice for React front-end work.

When to use Next.js instead of plain React

Use Next.js instead of plain React when public pages need server-side rendering for search, or when the app needs server code next to the UI. Otherwise, a client-rendered React app built with Vite is simpler to run.

The rendering model drives the choice. With server-side rendering, the Next.js App Router fetches data and builds HTML on each request. Static generation fetches data at build time and produces a fully static page, which suits content that can be publicly cached or pre-rendered for SEO. Incremental static regeneration refreshes those static pages on a schedule without a full rebuild.

The decision by project type:

Project type Recommended setup Rendering model Deciding condition
Content or marketing site Next.js App Router Static generation with incremental regeneration Search engines must read the content in the initial HTML
E-commerce catalog Next.js App Router Incremental regeneration for product pages, server-side rendering for personalized pricing Product pages drive organic traffic and stock or prices change between deploys
SaaS dashboard behind a login React with Vite and React Router Client-side rendering No public pages, so there is nothing for a crawler to index
Embeddable widget React with Vite (library mode) Client-side rendering The code ships as a bundle into a host page you do not control
Existing backend (Rails, Django, .NET, Java) React with Vite, or Next.js static export Client-side rendering or static generation The API already exists; add server rendering only if public pages need it

The operational cost sits on the Next.js rows. Server-side rendering, incremental regeneration and Route Handlers need a Node.js runtime or a host that emulates it. A static export needs only a file host, but it gives up features that require a server, such as incremental regeneration and Server Actions.

A Vite SPA ships no backend logic, so pair it with an API you already trust.

React Router vs Next.js routing

React Router maps URLs to components through routes you declare in code, while the Next.js App Router derives routes from the folder structure and attaches rendering behavior to each folder.

In a Vite app, React Router (library mode) is a package you configure. You define a route tree, nest children under a parent with Outlet, and wire up pending and error UI yourself. Loaders run in the browser. The Next.js App Router moves those decisions into file conventions:

Concern React Router (library mode) Next.js App Router
Route definition Route objects or JSX in code Folders containing page.tsx
Shared layout Parent route renders Outlet layout.tsx persists across child navigation
Loading state Pending UI you wire yourself loading.tsx wraps the segment in Suspense
Error handling errorElement per route error.tsx per segment
Code splitting lazy() per route, set up manually Automatic per route segment
Data loading Browser loaders Server Components fetch on the server
Server rendering Not included Built in, chosen per segment

React Router's framework mode (v7) closes much of this gap with a file-based route config, server rendering and server-side loaders.

We recommend the App Router when you want one set of conventions across the whole team and need server rendering. Explicit React Router config suits an existing client-rendered app, where migrating an existing React codebase would cost more than the conventions save.

The App Router's price is its reserved filenames and a steeper learning curve around the server and client boundary.

Data fetching: Client fetch in a Vite SPA vs an async server component

A Vite SPA fetches data in the browser after its JavaScript bundle loads, while an async server component fetches on the server and sends rendered output. The fetching code moves from the client bundle to the server, and that changes your waterfalls and your shipped JavaScript.

In a Vite app, TanStack Query is the usual choice for caching, retries, and deduplication:

// Vite SPA: runs in the browser
import { useQuery } from "@tanstack/react-query";

function Product({ id }) {
  const { data } = useQuery({
    queryKey: ["product", id],
    queryFn: () => fetch(`/api/products/${id}`).then((r) => r.json()),
  });
  return data ? <Details product={data} /> : <Spinner />;
}

The request starts only after the bundle downloads, parses, and renders this component. A child with its own query starts after the parent resolves, so nested components build a waterfall of round trips from the user's device.

With React Server Components in the Next.js App Router, the same screen looks like this:

// App Router: a server component by default
export default async function Product({ params }) {
  const { id } = await params;
  const [product, reviews] = await Promise.all([
    getProduct(id),
    getReviews(id),
  ]);
  return <Details product={product} reviews={reviews} />;
}

The fetch runs next to your database or internal API, with no browser round trip. The data client, the fetching code, and any heavy parsing library stay out of the bundle, and hydration covers only the client components. Sequential await calls still create a server-side waterfall, which is why this sample uses Promise.all().

The 'use client' boundary is where this breaks down. A file with that directive, and everything it imports, joins the client bundle. Placing it at the top of a layout pulls the whole subtree back into the browser. Keep it on small interactive leaves, and pass server-fetched data down as props.

TanStack Query still earns its place inside client components for polling, infinite scroll, and optimistic updates. Server Actions handle mutations from the server side, but they are public HTTP endpoints, so validate input and check authorization in each one.

Caching is where teams get surprised. Next.js 15 changed fetch to uncached by default, and later versions keep caching opt-in (Next.js Official Blog). A page you expected to be static may render on every request. Check the caching docs for your version, and confirm each route's behavior in the build output.

Next.js vs Node.js: Does Next.js replace your backend?

Next.js does not replace a backend. It runs on the Node.js runtime (or a compatible host) and adds Route Handlers and Server Actions, which cover the backend needs of a single web app.

Route Handlers are HTTP endpoints defined in App Router route files. Server Actions are server functions that components call directly, mostly for form submissions and mutations. Together they work well as a backend-for-frontend: sessions, database calls, third-party APIs, and data shaped for your own UI.

A Vite SPA has no backend layer and talks to whatever API you already run.

A dedicated API wins under these conditions:

Condition Why Next.js endpoints fall short
Multiple clients Server Actions are built for your React UI, not as a public contract. A React Native app or partner integration needs a versioned API with its own auth.
Long-running jobs Request-bound handlers suit short work. Imports, report generation, and video processing belong in a queue with workers.
Team boundaries A separate backend team needs its own language, release cadence, and deploy pipeline.

Treat every Server Action as a public endpoint and check authorization inside it, because anyone can send a POST to it.

We recommend Route Handlers and Server Actions when one team owns one web client. Keep domain logic in plain modules outside the handlers, so a later move to a separate service is a refactor and not a rewrite. For help drawing that line, see our web development services.

Performance: What Core Web Vitals say about each

Rendering location mostly affects Largest Contentful Paint (LCP), while client-side JavaScript mostly affects Interaction to Next Paint (INP), so the two stacks differ more on LCP.

A client-rendered React app built with Vite ships a near-empty HTML shell. The browser must download and run JavaScript before the largest element paints. Next.js App Router renders HTML on the server or at build time, so LCP content arrives in the first response. Static generation uses data fetched at build time; server-side rendering fetches per request and adds server time to each response.

INP depends on main-thread work in the browser. React Server Components send no component JavaScript to the client, which reduces hydration cost, but every 'use client' boundary adds it back. A Next.js page with heavy client components can fail INP as a SPA can.

According to web.dev's Core Web Vitals guide, a good LCP is 2.5 seconds or less and a good INP is 200 milliseconds or less, both measured at the 75th percentile of page loads.

Vite and Turbopack are build tools: Vite serves React SPAs, and Turbopack bundles Next.js. React Compiler memoizes components automatically and works in both setups. Our view is that none of the three should decide the stack. The rendering model should, and for pages behind a login, where search indexing is irrelevant, a well-split SPA is a reasonable front-end build.

What Next.js costs to run, and what migration involves

Next.js costs more to operate than a static React app because server features need a Node.js runtime or a compatible host, and React Server Components add attack surface that a client-only bundle does not have.

The failure modes show up in four places:

  • Static export drops server features. With output: 'export', Next.js emits plain HTML, CSS, and JavaScript for any static host. Incremental static regeneration, request-reading Route Handlers, Server Actions, and middleware (renamed proxy in Next.js 16) stop working. Static generation fetches data once at build time, so content changes need a rebuild.
  • Incremental static regeneration needs a server and a shared cache. Pages revalidate at runtime, so with several instances behind a load balancer, each needs the same cache handler. Otherwise users can see different versions of one page. Our high-traffic website guide covers the caching layers around this.
  • Caching defaults change between major versions. Re-test fetch and route caching after every upgrade, because stale or uncached pages are the usual surprise.
  • Patching runs on your schedule. In December 2025, the React team disclosed an unauthenticated remote code execution flaw in React Server Components (CVE-2025-55182, rated CVSS 10.0), with a matching Next.js advisory (CVE-2025-66478). Later advisories covered denial of service and source code exposure. A Vite SPA with no server component endpoint sat outside that surface; a Next.js team should plan patch turnaround in days.

Migrating a Vite SPA works best in this order:

  1. Routing. Move React Router routes into App Router folders one route at a time. The Next.js docs describe a Vite migration path that first ships the SPA as a single client-only entry point.
  2. Data fetching. Replace useEffect fetches with async Server Components where data is needed at first paint. Keep 'use client' for interactive leaves.
  3. Auth. Tokens in localStorage are invisible to server rendering. Move to HTTP-only cookie sessions, and verify access in the data layer, not only in proxy or middleware.

If the app is mostly authenticated dashboards, the migration may cost more than it returns. Staying on Vite with React Router is a defensible outcome, and our React development team treats it as one.

Other React frameworks, and our verdict

React Router framework mode and TanStack Start are the main alternatives to the Next.js App Router. Both build on Vite and add server-side rendering, so the choice between them depends on SEO need, hosting constraints, and what the team already knows.

The decision rule we use:

Condition Choose
Public pages must rank, or you need Server Components and incremental static regeneration, and a Node host is acceptable Next.js App Router
You want server-side rendering with Vite tooling, loader-based data fetching, and fewer host assumptions React Router framework mode or TanStack Start
The app sits behind a login, ships as an embedded widget, or talks to an existing backend with no need for server rendering Vite single-page app

Create React App belongs in none of these rows: the React team deprecated it in February 2025.

We recommend Next.js as the default for content, e-commerce, and any product where search traffic pays the bills. In the Stack Overflow 2025 survey, 44.7% of respondents used React and 20.8% used Next.js, so hiring for either stack is practical.

We recommend a Vite-based framework when the team already uses React Router or TanStack Router, or when your host rules out a Node runtime. A plain Vite SPA is the right call for authenticated tools, because server rendering adds operational cost without adding value there.

The weak point of this advice is team familiarity. A team fluent in one tool will often ship faster with it than with a better-fitting one.

Our React development and front-end development teams can pressure-test the choice against your constraints, and if you want a second opinion, send us your project and we will tell you which route we would take for your web development scope.

Next.js vs React FAQ

Is Next.js replacing React?

No, Next.js depends on React and cannot replace it. react.dev recommends starting new apps with a framework, and Next.js is one of several, alongside React Router and Expo. A Vite single-page app is still a sound choice for client-heavy tools behind a login, so React remains usable without Next.js.

Should I learn React before Next.js?

Yes, learn React first, because Next.js code is React code with extra rules. Components, props, state, and hooks carry over directly, and the App Router adds the split between Server Components and Client Components at the 'use client' boundary. Without those fundamentals, hydration errors and server-only code mistakes are hard to debug.

Is Next.js still relevant?

Yes, Next.js is still a strong default for SEO-dependent sites, e-commerce, and full-stack apps that need server rendering or incremental static regeneration. It ships regular releases, and Turbopack is its default bundler. Server features need a Node runtime or compatible host, and the December 2025 React Server Components advisories make prompt patching part of the cost.

We're Netguru

At Netguru we specialize in designing, building, shipping and scaling beautiful, usable products with blazing-fast efficiency.

Let's talk business