Engineering8 min read

React with Vite or Next.js? Answer three questions and it decides itself

This gets argued as a preference. It is not — it is a consequence of what your pages have to do. Three questions settle it, and getting it wrong is expensive in a specific and predictable way.

Muhammad Qasim, author

Muhammad Qasim

Full Stack Developer · Rawalpindi, Pakistan

About the author

Short answer

If pages must rank in search or load fast for first-time anonymous visitors, use Next.js. If the product sits entirely behind a login, React with Vite is simpler and enough.

01Question one: does anything need to rank?

This is the decisive question and it is usually answered too casually. If marketing pages, case studies, documentation or a public catalogue need to appear in search results, you need HTML that exists before JavaScript runs. Next.js gives you that as a default. A client-rendered Vite app gives you an empty container and a dependency on Google's rendering queue.

I learned the cost of getting this backwards on my own portfolio. It was a Vite single-page app, and Search Console reported nineteen of twenty pages as discovered but not indexed. Every URL returned the same empty shell with the same title. Fixing it meant adding a prerendering step and eventually moving to Next.js — work that would have been free if the first decision had been right.

Retrofitting server rendering onto a client-only app is a structural change, not a configuration change. Decide this before you start.

02Question two: who experiences the first load?

For an internal dashboard, the answer is a logged-in user who opens it every morning and has everything cached. A slow first load costs them a few seconds once. Client-side rendering is entirely reasonable.

For anything public-facing, the first load is a stranger on a phone on a mediocre connection deciding whether your product is worth their attention. Server rendering the initial view materially changes what they see in the first second.

This is why the two products I would build differently are almost the same size. A CRM behind a login: Vite. A marketing site with a product catalogue: Next.js. Not because one framework is better, but because the visitors are different people in different situations.

03Question three: what can the team operate?

Next.js is a server framework. That means a Node runtime to deploy, caching semantics to understand, and a meaningful distinction between server and client components that will confuse anyone who has only written client React. On a managed platform much of this disappears, which is why the honest answer is usually "yes, fine". On self-managed infrastructure with no one who wants to own it, that is a real cost.

Vite builds static files. Any static host serves them. There is no runtime to operate, no cold starts and no server-client boundary to reason about. For a team of one shipping an internal tool, that simplicity is worth something.

  • Public pages that must rank, or a content-heavy site: Next.js.
  • Product entirely behind authentication, no SEO surface: React with Vite.
  • A mix — marketing site plus an app: Next.js for the marketing surface, and it is fine for the app too.
  • A genuinely static site with a handful of pages: consider whether you need a framework at all.

04What does not belong in this decision

Bundle size and benchmark numbers get quoted constantly and rarely decide anything real. At the scale most projects operate, your bundle is large because of what you imported, not because of which build tool assembled it.

What does matter, and is easy to underestimate, is that these are not equally reversible choices. Moving from Vite to Next.js means restructuring routing, data fetching and rendering. Moving the other way means giving up server rendering, which you probably adopted for a reason. Spend the afternoon on this one.

TopicsReactNext.jsViteSSRArchitecture

Found this useful?

I write these from live project work. Follow along or get in touch if you want this kind of thinking applied to your product.

Quick answers

Is Next.js always better than React with Vite?+

No. Next.js is better when pages need to rank in search or load fast for first-time anonymous visitors. For a product that lives entirely behind a login, React with Vite is simpler to build and operate with no meaningful downside.

Can I add server-side rendering to an existing Vite app?+

You can add build-time prerendering relatively cheaply, which solves indexing. Full server rendering is closer to a restructure, since it changes how routing and data fetching work throughout the application.

Does Next.js hurt performance for a dashboard?+

Not inherently, but the benefit is small when every user is authenticated and returning, and you take on server runtime complexity for it. That is the trade-off worth weighing rather than any raw performance difference.

Keep reading

All articles

Projects behind this article

The production systems where these decisions were made.

All case studies
  • Muhammad Qasim Developer Portfolio — Developer portfolio project preview
    Developer portfolioSEO portfolio

    Muhammad Qasim Developer Portfolio

    A developer portfolio for Muhammad Qasim showcasing SaaS, CRM, dashboard, AI automation and production work

    Read case studyLive
  • Keynou Flow — SaaS project preview
    SaaSTask management

    Keynou Flow

    A SaaS task and workflow platform with role-based access, subscriptions, todos and structured data managemen

    Read case studyLive
  • CallLoom Landing Page — Landing page project preview
    Landing pageSaaS marketing website

    CallLoom Landing Page

    A Next.js marketing landing page for an inbound call tracking system, covering features, pricing and convers

    Read case studyLive
  • Keynou Tools All-in-One Utility Platform — Online tools platform project preview
    Online tools platformSaaS utilities

    Keynou Tools All-in-One Utility Platform

    An all-in-one online tools platform with image, PDF, video, converter, compressor and QR utilities, built wi

    Read case studyLive

Related services

If this describes a problem you have right now, these are the ways I can help.

All services
  • React Development

    Most React problems are not React problems — they are structure problems. I build frontends with a component system,

    Explore service
  • Performance & SEO

    A site that Google cannot render is a site Google will not rank. Most technical SEO failures I find are not content

    Explore service
  • SaaS Development

    Taking a SaaS idea to paying customers means solving multi-tenancy, billing, permissions and analytics before you wr

    Explore service
  • API & Integrations

    Integrations fail quietly. I build them with retries, logging and clear failure states, so when a third-party servic

    Explore service