Skip to content

Comparison

Next.js vs React: What Should You Choose in 2026?

Next.js is built on React, so the real choice is React with Vite or React with Next.js. We built the same page with both and moved our own site. Here is when each one fits.

Written by Osmosys TeamPublished 7 min read

Diagram: the same page built two ways. React with Vite sends an empty div and 66.2 KB of JavaScript; Next.js sends the page content and 131.6 KB of JavaScript.

Short answer

Next.js is not an alternative to React. It is a framework built on React, so the real choice is React with a build tool such as Vite, or React with Next.js. Choose Next.js for pages that must be found in search or shared as links, because it puts each page's content and title in the HTML. Choose React with Vite for apps behind a login, where search does not matter and you want the simplest setup. React's own documentation recommends starting new apps with a framework.

On this page

React or Next.js is the wrong question

React is a library for building user interfaces. Next.js is a framework that uses React and adds routing, rendering at build time or on a server, page metadata and a production build. Every Next.js app is a React app.

So the choice people actually face is how to start a React project:

  • React with a build tool. React's documentation names Vite, Parcel and Rsbuild.
  • React with a framework. React's documentation recommends Next.js (App Router), React Router and Expo.

React's advice is direct: "If you want to build a new app or website with React, we recommend starting with a framework." When it deprecated Create React App in February 2025, it added a rule of thumb: "if your app needs routing, you would probably benefit from a framework."

Key differences

React with ViteReact with Next.js
What you getA UI library and a build toolA framework on top of React
The HTML of a pageAn empty container. JavaScript builds the content in the browserThe page's content, made at build time or on a server
RoutingYou add a routerFolders in app/ become addresses
Title and description per pageYou add a library or your own codeThe Metadata API, included in the initial HTML
Sitemap and robots.txtYou write or generate themsitemap.ts and robots.ts files
A page that does not existThe usual single-page fallback loads the app for every unknown address, with status 200, unless you handle itA not-found page. A static export writes it to 404.html, which hosts such as Cloudflare Pages serve with a 404 status
Server-side renderingA low-level API, which Vite describes as "meant for library and framework authors"Built in
HostingAny static hostAny static host with a static export, or a Node.js server for server features

React's documentation spells out the trade-off of starting from a build tool: it "start[s] off with a client-only, single-page app (SPA)" without routing, data fetching or styling, and "going this route is often the same as building your own adhoc framework."

We compared both on the same page

On 26 November 2026 we created one app with each starter (create-vite with the react-ts template, and create-next-app) and replaced the starter page with the same component: a heading, a paragraph and a list of three items. The Vite app was built with npm run build. The Next.js app was built as a static export (output: 'export'), the same way this website is built.

Versions: React 19.3, Vite 8.4.0, Next.js 16.4.6, Node.js 22.

Measured on the built home pageReact with ViteNext.js, static export
Content in the HTML before any JavaScript runsNone, only <div id="root"></div>The heading, the paragraph and the list
Size of the HTML file384 bytes5,243 bytes
JavaScript files the page loads15
JavaScript, compressed with gzip66.2 KB131.6 KB

What it shows:

  • Next.js delivers the content in the HTML. A crawler, a link preview or a reader on a slow connection gets the text without running any code.
  • Next.js loads more JavaScript. For this small page it was about twice as much. Real pages add their own code to both.
  • The Vite page is empty until its script runs. Google can render JavaScript, but it queues pages for rendering: "The page may stay on this queue for a few seconds, but it can take longer than that." Google also notes that "not all bots can run JavaScript." OpenAI, Anthropic and Perplexity do not say publicly whether their search crawlers run JavaScript, so text in the HTML is the safe option for pages you want found.

What happened to our own site

This website was a React and Vite single-page app until November 2026. Our audit before moving it to Next.js found three problems, all recorded in our migration notes:

  1. Missing pages returned status 200. The host sent every unknown address to the app (/* /index.html 200), so a mistyped address showed a "not found" message with a success status. Google calls this a soft 404, and says meaningful status codes in client-side apps "can be impossible or impractical."
  2. Most pages shared one title. Titles were set in the browser by our own code, and only three page types had their own. The rest used the home page's title and canonical address.
  3. The prerendered pages never went live. We had a separate script that saved a snapshot of each page with a headless browser. The host's build command ran only vite build, which skips that script. When we checked the live old site in November 2026, the HTML of its home page held only an empty <div id="root"></div>.

None of this is a fault in Vite. Each problem can be fixed in a Vite app. The point is that we would have been building and maintaining those fixes ourselves.

After the move, the site is a Next.js static export on Cloudflare Pages, with no server:

  • Each page is an HTML file with its own title, description and canonical address.
  • Unknown addresses return a real 404 page.
  • The sitemap and robots.txt are generated at build time.
  • Lighthouse on mobile scores 100 for SEO, accessibility and best practices. Performance on the home page ranged from 74 to 93 over five runs on a busy laptop.
  • The home page fell from 11.6 MB to about 420 KB. Most of that came from replacing large PNG screenshots with compressed images, not from the framework.

Advantages and limitations

React with Vite

Advantages

  • The smallest setup, and a fast development server.
  • The build is plain static files that any host can serve.
  • You choose every library.
  • It suits apps behind a login, where search engines never look.

Limitations

  • Routing, data fetching, page titles, prerendering and missing-page handling are yours to choose and maintain.
  • Pages are empty until JavaScript runs, unless you add prerendering or server-side rendering.

Next.js

Advantages

  • Content and metadata are in the HTML of every page.
  • Routes, the sitemap, robots.txt and the not-found page follow file conventions.
  • A site can start as a static export and add server features later.
  • React's documentation recommends it.

Limitations

  • It loads more JavaScript for small pages, about twice as much in our comparison.
  • There are more concepts to learn. Pages are Server Components by default, and interactive parts need the "use client" directive.
  • A static export cannot use features that need a server. The documentation lists cookies, redirects, headers, Proxy, Incremental Static Regeneration, Server Actions and the default image optimization among them. For this site we set redirects and security headers at the host instead.
  • It changes often. Next.js 16 made Turbopack the default bundler and replaced middleware.ts with proxy.ts. From 16.4, new apps have Cache Components turned on by default.

Which one is best for your project?

Your projectChooseWhy
Company website, blog, documentation, landing pagesNext.jsPages must be found in search and shared as links
Shop or listing site with many pagesNext.jsEach page needs its own content, title and place in the sitemap
Dashboard, admin panel or internal tool behind a loginReact with ViteSearch does not matter, and the setup is simpler
A widget embedded in another siteReact with ViteNo pages or routing needed
A mobile appNeither. React Native, for example with ExpoReact's documentation lists Expo for native apps

Our recommendation

  • Anything public that should bring visitors or enquiries: start with Next.js. If it needs no server, use a static export and host it as static files, as we do.
  • An app behind a login: React with Vite is simpler and loads less JavaScript.
  • Create React App: do not use it for new projects. React deprecated it in February 2025.
  • An existing React site with search problems: check three things before changing anything. Open the page source and look for your text. Visit a made-up address and check the status code. Compare the titles of three pages. If they fail, moving to Next.js is one fix. It is the one we chose for this site.

If you are planning a new site or rebuilding one, our web development and custom software pages describe how we work.

Common questions

Is Next.js better than React for SEO?

Next.js uses React, so compare the setups. Next.js puts each page's content and metadata in the HTML. A React app built with Vite sends an empty page that JavaScript fills in, unless you add prerendering or server-side rendering. Google can render JavaScript, but not every crawler can.

Should I learn React or Next.js first?

Learn React first: components, props, state and hooks. Next.js uses all of them and adds routing and rendering on top, so its documentation makes more sense once React is familiar.

Is Next.js faster than React?

It depends on what you measure. A Next.js page shows its content as soon as the HTML arrives, but in our comparison it also loaded twice as much JavaScript. For a small app behind a login, the Vite build is lighter.

Can I use Next.js without a server?

Yes. With output: 'export', Next.js writes an HTML file for each route, and any static host can serve them. Features that need a server, such as cookies and Server Actions, are not available. This website runs that way.

What about React Router instead of Next.js?

React's documentation recommends React Router (v7) as well as Next.js. We have not built a production site with React Router as a framework, so we do not compare the two here.

Sources

  1. Creating a React App, React documentation. Checked 26 November 2026.
  2. Build a React app from Scratch, React documentation. Checked 26 November 2026.
  3. Sunsetting Create React App, React blog. Checked 26 November 2026.
  4. React Versions, React documentation. Checked 26 November 2026.
  5. Next.js 16, Next.js blog. Checked 26 November 2026.
  6. Next.js 16.4, Next.js blog. Checked 26 November 2026.
  7. Static Exports, Next.js documentation. Checked 26 November 2026.
  8. generateMetadata, Next.js documentation. Checked 26 November 2026.
  9. not-found.js, Next.js documentation. Checked 26 November 2026.
  10. Server and Client Components, Next.js documentation. Checked 26 November 2026.
  11. Getting Started, Vite documentation. Checked 26 November 2026.
  12. Server-Side Rendering, Vite documentation. Checked 26 November 2026.
  13. Understand JavaScript SEO basics, Google Search Central. Checked 26 November 2026.

From our work