Next.js vs React: choose the application boundary, keep the UI layer
For a new React application, evaluate a framework first. Next.js is a strong candidate when its App Router, Server Components, server functions and hosting model fit the product. React's own guidance also points to React Router and other frameworks. Build directly on React with a tool such as Vite when the app has a clear reason to own routing, data, server rendering and deployment integration itself. In every path, React remains the component and UI layer.
Next.js 16.4 App Router with React 19.3. This guide explicitly selects Cache Components with cacheComponents: true, use cache and cacheLife; existing applications may have different configuration and cache behavior. Next.js is a React framework, so this is a choice about application routing, rendering, data, caching and deployment boundaries, not a choice between UI libraries. Older Next.js cache models have different defaults and are not interchangeable with the examples here.
Next.js uses React. React defines component rendering and UI state; Next.js adds application-level conventions around routes, server and client execution, data access, cache behavior and deployment. A useful decision names which team owns each boundary and demonstrates the behavior on a real route.
Compare the practical consequences
Scroll sideways to compare all columns on a smaller screen.
Next.js and React by decision criterion
Criterion
Next.js
React
What changes the decision
A new routed React application
Next.js supplies an integrated App Router and full-stack conventions.
React Router and other frameworks are valid third options; a build tool plus React is also possible when the team deliberately owns the missing framework pieces.
Compare Next.js with the team's actual framework candidates. Treat a from-scratch React setup as a deliberate ownership choice, not React's default recommendation.
Server-rendered or mixed public and personalized pages
Next.js App Router composes Server Components, Client Components, streaming and cached or request-time work.
React itself does not prescribe a route-level server rendering or cache policy; select a framework or assemble those boundaries.
Trace one real request, including the host adapter, to verify the shell, personalized content, errors and browser interaction.
Interactive UI and component reuse
React owns components and browser interaction inside a Next.js application; client boundaries are explicit, but Client Components may also be prerendered on the server.
React owns component composition, state and rendering in either framework or custom setup.
Keep UI behavior and domain operations separable. A Next.js choice does not remove React skills or component-level testing.
Tenant-scoped public catalog cache
With Next.js 16.4 Cache Components, explicitly cache the public catalog and give it a freshness policy, key and tenant tag; coordinate the cache across instances when required.
Use the current framework or a shared data layer's cache, with equally explicit key, freshness and invalidation ownership.
Test a database commit followed by invalidation failure across two instances. A successful write does not prove every cache or CDN has refreshed.
Private reads and mutations
Next.js gives server-side boundaries, but every read and server function still needs authorization and validated input.
A separate API can own these checks; the client UI remains an untrusted caller either way.
Authorize at the data access boundary on reads and inside each mutation endpoint. Do not treat hidden buttons, action identifiers or cache keys as permission checks.
Static hosting or request-time server behavior
Next.js can emit a static export, but dynamic request APIs, Server Actions, Proxy and ISR are not supported by that export mode.
React can be deployed as static client assets when the application does not require server behavior, with routing and data behavior selected separately.
Write down which work happens at build time and which requires a live server before choosing static hosting.
Streaming and deployment adapter
Next.js supports streaming, but the reverse proxy, load balancer and platform must pass the response through without buffering; feature support varies by adapter.
The selected React framework and runtime determine the same hosting requirements.
Exercise the production route through the actual adapter and proxy. A local dev server cannot establish end-to-end streaming support.
Mixed-build rollout
Next.js provides deployment identifiers and server-action encryption-key guidance for multi-instance deployments, but schema, assets, action compatibility and cache namespaces still need a rollout plan.
A custom stack has different version coupling, which the team must make explicit and operate.
Test old and new clients against the rollout overlap. A shared key or matching build identifier alone does not make arbitrary versions compatible.
Hiring, salary evidence and team fit
Next.js roles still require React understanding plus framework-specific server, routing, cache and deployment skills.
React roles can require deeper ownership of the chosen router, data fetching, server rendering and build setup.
Use job posts and salary panels as evidence about the sampled cohort and stated role requirements, not proof of market demand, a framework salary premium or a universal hiring advantage.
Which layer owns the route and which owns the component?
Next.js owns application concerns such as file-based route matching and server rendering; React owns component composition, state and UI updates. A Next.js route renders React components and may include client boundaries for browser interaction.
For a catalog route, Next.js matches /products/42, loads server data and renders the page. React components build the product UI and a client quantity control. The framework and UI library solve connected but different jobs.
If the team replaces Next.js with another React framework, its React components may remain useful. Framework-specific conventions such as file routing, server functions and cache APIs still need migration.
Request ownership trace · Worked example
Browser requests /products/42
Framework: route match, server data boundary, response and deployment adapter
React: product components, props, state and rendered UI
Browser: hydrate interactive Client Component boundaries
This conceptual trace assigns a single request across layers. It is a worksheet for naming ownership, not executable code or a performance result.
Non-executable ownership trace; no runtime claim.
Follow-up: Is Next.js a replacement for React?
No. Next.js uses React. A Next.js application still builds and tests React components.
Should a new app choose Next.js, another framework, or React from scratch?
Start by comparing frameworks. React recommends a framework for new apps because routing, data loading, code splitting and server integration otherwise become work the team must design and maintain. Choose Next.js when its boundaries fit; choose another React framework when its runtime or conventions fit better. Build directly on React only when the constraints or learning goal justify owning those pieces.
A useful comparison names the actual candidates: for example, Next.js App Router for its integrated full-stack route model, React Router framework mode for its route-centered approach, or React plus a build tool for a deliberately client-only application. These options are not interchangeable; compare the server runtime, route model, data boundary and deployment target that the product needs.
React's documentation says its recommended frameworks can also support client rendering and static hosting. A framework choice does not automatically require a server for every page. Conversely, selecting a bundler and React does not give the application a server data layer or request-time rendering by itself.
Three-path decision worksheet · Worked example
Requirement: product catalog, account pages, tenant data, one deploy target
Next.js: test App Router, Server Components, Cache Components and adapter support
Other React framework: test its route/data model against the same requirements
React + build tool: list the owners for routing, data, SSR, cache and deployment
Decision: pick the path with the fewest unowned requirements and acceptable limits
Fill each line with the team's real candidate and hosting constraints. This is an evaluation worksheet, not executable code.
Non-executable decision worksheet; candidates depend on workload.
Follow-up: When is React from scratch reasonable?
When the app is intentionally client-only or embedded, an existing platform owns routing and data, a framework cannot meet a concrete constraint, or the team explicitly wants to build and maintain those integrations.
React describes UI rendering; it does not by itself choose the application's route-level server rendering, data cache or deployment model. Next.js App Router integrates React Server Components and Client Components into that model.
If a page is mostly public content with a small interactive control, server-rendered content plus a narrow client boundary may fit. If the app is an embedded client panel whose host already owns navigation and data, a full framework route may duplicate a boundary.
A Client Component can still be prerendered on the server for the initial response. The 'use client' directive marks a client module boundary; it does not mean the component only ever runs in a browser. Browser-only APIs must be accessed in browser-safe code such as an event handler or effect.
Route rendering trace · Worked example
Request: /products/42
Server render: public product summary + personalized availability boundary
HTML stream: shell first, slower availability when ready
Browser: hydrate quantity selector and cart interaction
Use this trace to ask which content can be public, which needs request-time identity, and whether the host can stream it. It does not predict latency.
Non-executable rendering trace; no timing result.
Follow-up: Does server rendering always make an interface faster?
No. It can deliver useful HTML before client code runs, but server latency, streaming support, hydration, JavaScript weight and cache behavior still determine the user experience. Measure the actual route and interaction path.
Who owns data fetching, cache keys and invalidation?
React component composition does not define a shared server cache policy. This guide selects Next.js 16.4 Cache Components: select cacheComponents: true and partialPrefetching: true, mark a specific function or component with use cache, and set an explicit cacheLife. New apps created by the current starter may enable Cache Components by default; existing applications can have different configuration and cache behavior. The application still owns key inputs, authorization scope, freshness and repair.
On every request, authenticate and authorize outside the cached function before accessing it; a cache hit may return without rerunning the cached body. Pass only the permitted public cache dimensions as key inputs and return a narrow tenant-public DTO. If a result varies by tenant, the tenant must be represented in the key or the data must not be shared across tenants. A cache key is a partitioning mechanism, not an authorization check.
This page's example uses Cache Components, not the previous App Router cache model. Under Cache Components, dynamic work is request-time by default and caching is explicit. Do not combine this recipe with legacy route segment settings such as revalidate as if the behavior were identical.
The selected Cache Components configuration requires the Node.js runtime. Current configuration guidance does not support a runtime route-segment export, including an Edge runtime selection. A static-export design is a separate build/deployment choice to validate against the features that route actually uses, not an assumption that this live cache model works on every host.
One cache entry contract · Worked example
Data: public catalog for tenant acme
Key inputs: tenantId=acme, catalogId=main (fixed domain key)
Cached value before write: catalog version 7
Tag: catalog:tenant:acme
Freshness: target at most 60 seconds; configure and verify actual cacheLife stale/revalidate/expire behavior
Owner: catalog mutation path requests invalidation; operations monitors propagation
The 60-second target is an example product limit, not a guarantee from a TTL or tag call. Configure and verify the actual cacheLife stale, revalidate and expire behavior against the selected cache handler.
Non-executable cache contract; the product must set the freshness limit and verify it with its handler.
Follow-up: Can the framework decide which data may be shared between users?
No. The application decides what is public, scopes cache keys and enforces authorization. Framework primitives implement cache mechanics, not the domain permission model.
What happens when one of two instances misses an invalidation?
With two Next.js instances and process-local caches, a database commit on instance A followed by a failed or local-only invalidation can leave instance B serving its previous cached catalog until its own entry expires or another repair reaches it. Do not infer global read-after-write consistency from a successful commit or from calling revalidateTag once.
For this example, the cached value is a narrow tenant-public catalog DTO for acme, keyed by fixed domain inputs tenantId=acme and catalogId=main, and tagged catalog:tenant:acme. The cached value is version 7 before the write; after the database commits version 8, the same key can still resolve to version 7. The catalog mutation path owns repair. A 60-second maximum-staleness target is only a product requirement: configure and verify the actual cacheLife stale, revalidate and expire behavior with the selected handler. A TTL or tag call alone does not guarantee the target.
Next.js 16.4's Cache Components use cacheHandlers (plural) to configure storage for use cache and use cache: remote. The older singular cacheHandler configures the previous cache model for ISR and server response caching. They serve different models and should not be combined into one recipe. For multi-instance Cache Components, shared storage alone is insufficient if tag state is not coordinated; the handler's refreshTags() hook is the documented coordination point to sync invalidation state before requests.
A tag event may fail after the database has committed. Report the mutation outcome accurately, retain a retryable invalidation/repair record and alert the owner. If the accepted staleness window cannot be met, use an authoritative read fallback or return an unavailable state; do not serve stale data indefinitely, erase the committed write, or blindly repeat a non-idempotent mutation. Replay a mutation only when its outcome is known and the operation is idempotent.
Next.js cache state, the browser's client Router cache and a CDN/reverse-proxy cache have separate owners and refresh paths. Confirm each path for the chosen route. Deployment IDs and consistent Server Action encryption keys address version routing and action decoding concerns; they do not make all cached content fresh.
Two-instance failure timeline · Worked example
t0 A and B both hold catalog:tenant:acme at version 7
t1 A commits catalog version 8 in the database
t2 A requests tag invalidation; shared tag propagation fails
t3 A's process may refresh locally; B still has version 7
t4 A mutation reports committed; it does not replay the database write
t5 Repair owner retries/repairs tag propagation; verify A and B, Router cache and CDN independently
This is an operational failure trace. The exact user response, repair queue and maximum stale window depend on the application's write and consistency contract.
Non-executable two-instance trace; no framework guarantee of global consistency.
Follow-up: What should be tested before adding a shared cache handler?
Run a write on instance A, force invalidation propagation to fail, read through B, restore propagation and verify the documented recovery path. Also test browser navigation and CDN behavior separately, then compare the observed stale window with the product's explicit allowance.
Where must authorization run for reads and mutations?
Authorize every sensitive read in the server-side data access path and every mutation inside the server function or endpoint that performs it. A Server Component is a useful server boundary, not a substitute for checking the caller's permission. A Server Action is a public-facing POST endpoint and must be treated like one.
Use a server-only data access layer to verify the session, apply tenant and record-level permissions, and return a minimal DTO. Check permission on each read, including reads reached through a cached function. Never pass secrets, database rows with unnecessary fields, or privileged values into a Client Component.
Validate form fields, route parameters and other client input at the trust boundary. Hiding an admin control in React improves presentation but does not authorize the action. Next.js action identifiers and same-origin protections are defense features, not permission checks.
Read and write boundary map · Worked example
Page request -> verify session -> authorize tenant -> load minimal catalog DTO
Mutation POST -> validate input -> verify session again -> authorize record -> commit
After commit -> request cache invalidation -> report refresh outcome separately
The map shows checks at trust boundaries. It is not an implementation or a claim that a particular identity provider is configured.
Non-executable authorization trace; application security review still required.
Follow-up: Can a Server Component safely return a database record to a client widget?
Only after the server has authorized the read and selected the fields the widget needs. Server execution does not make data safe once it is passed to the browser.
Can the app run on static hosting, or does it need a live server?
Next.js can generate a static export when every route's server work is computable at build time and the required features fit the export limits. If the request needs cookies, headers, Proxy, Server Actions, ISR or other request-time behavior, static export is not the same deployment model as a running Next.js server. React can also be served as static assets, with server behavior supplied separately if needed.
With output: 'export', Server Components run during the build and produce static HTML and navigation payloads. Dynamic route parameters must be generated, and route handlers must produce static GET output; they cannot inspect the incoming request. The static export guide lists unsupported features, including cookies, redirects, rewrites, Proxy, Server Actions, ISR and default runtime image optimization.
If the route needs request-time identity or mutation, use a supported server runtime or move that capability to an explicitly separate service. Then decide whether Next.js's adapter supports the required route behavior. Static assets do not provide a secure place for server secrets or tenant authorization.
Build-time versus request-time worksheet · Worked example
Product marketing page: public content, known route -> can be generated at build
Account catalog: cookie/session and tenant authorization -> request-time server/API needed
Cart mutation: authenticated POST and database write -> server endpoint/action needed
Image transforms: default runtime optimizer -> needs server, or choose a custom loader
Classify each route and operation before choosing the host. The entries are examples, not a recommendation to expose private account data statically.
Non-executable deployment worksheet; confirm the selected Next.js version's export support.
Follow-up: When is a static export a good fit?
When the required pages can be generated without request-time secrets, identity, mutation or dynamic server APIs, and the team accepts the hosting and refresh behavior of generated files.
React-level failures include invalid component identity, stale state assumptions and unhandled client errors. Next.js adds route resolution, server rendering, server-function, cache and deployment-adapter failure modes.
A component works in a client-side test but fails during server rendering because it reads window at module load. A Client Component can still be prerendered on the server, so move browser access into an effect or event handler, or deliberately isolate a subtree that cannot be rendered there.
A route serves stale data after a mutation because tag invalidation did not reach every runtime instance. That is an application/cache topology problem beyond React's rendering model. Observe invalidation outcomes without logging tokens, private payloads or other sensitive values.
Follow-up: How do you isolate a hydration mismatch?
Compare server HTML with the first client render, remove browser-only nondeterminism from render, and inspect which client boundary owns the mismatch. Reproduce with a production build and the target adapter.
How can a team test the choice and keep a way back?
Run one reversible pilot route that exercises the application's real identity, tenant data, cache invalidation, metadata, streaming and failure behavior. Keep the existing route available until the pilot passes agreed checks. Expand only when the framework removes a measured user or operating burden.
Before building, write the route's public/private data map, the cache key and freshness allowance, who repairs a failed invalidation, and the host's streaming/static requirements. During the pilot, verify unauthorized reads and mutations fail; tenant A never sees tenant B's catalog; an invalidation failure is visible and recoverable; the intended stale window is met across both instances; and browser navigation and CDN refresh are separately understood.
Stop the pilot if it cannot enforce the data boundary, invalidation failures can silently persist past the accepted freshness allowance, the deployment adapter buffers a required stream, or the operational owner cannot diagnose the failure. Keep the old route serving traffic while resolving the issue; do not expand based on a successful happy-path demo.
To reverse, record framework-specific route, server-function, cache and deployment modules. Keep domain operations behind server-only interfaces and component contracts stable enough to reuse. Rollback must include the old route and cache behavior, not just a switch in the browser.
Pilot acceptance card · Worked example
Success: authorized and unauthorized read/write cases pass
Success: tenant key/tag isolates data and two-instance invalidation is observed
Success: freshness limit, stream path and adapter behavior meet written requirements
Success: error owner, alert and repair path are exercised
Stop: private data crosses a cache or client boundary; stale data has no bounded repair; required stream is buffered
Rollback: restore old route and verify its data/cache behavior
Agree the product's actual freshness and availability limits before running the pilot. These checks are acceptance criteria, not completed test results.
Non-executable acceptance worksheet; not evidence that a pilot has run.
Follow-up: When should the team stay with its current React stack?
Stay when its router, rendering, data and deployment practices meet the requirements and a new framework would add parallel conventions without a concrete user or operating benefit.
What must remain compatible while two builds serve traffic?
A rolling Next.js deployment can leave an old browser page sending a Server Action or requesting an asset while a new replica serves the request. Plan version routing, action decoding, manifests, assets and cache/schema compatibility together; a deployment identifier or shared encryption key alone cannot make arbitrary builds compatible.
Next.js documents deployment identifiers for version-skew protection and a consistent Server Action encryption key across instances of the same deployment. These address specific routing and decoding failures. They do not guarantee that an old action identifier exists in the new build, that old JavaScript assets remain available, or that cached values and database schema are compatible across versions.
Before rollout, choose how long old assets remain available, whether actions are pinned to a deployment or accepted by compatible replicas, which cache namespaces each build reads, and how schema changes remain backward compatible during overlap. Protect unsaved browser input while refreshing or redirecting a stale page. On a version mismatch, surface a recoverable refresh path without discarding the user's work.
Do not replay a mutation merely because the old page did not receive a response. First determine whether the server committed it; only replay when the outcome is known and the operation is idempotent. Stop rollout if clients can lose unsaved input, actions can execute twice with uncertain outcome, or one build cannot read the other's required cache/schema state.
Mixed-build compatibility trace · Worked example
Old browser page -> action/asset request reaches new replica
Check: deployment routing and action manifest support this client version
Check: required old assets remain available; cache key/schema are compatible
If mismatch: preserve form input, explain refresh, do not guess whether mutation committed
Resume only after rollout compatibility and rollback path are verified
This trace names rollout questions; it is not an executed test or a guarantee provided by deploymentId.
Non-executable rollout trace; version compatibility must be tested for the chosen deployment.
Follow-up: What is the stop condition for a mixed-build rollout?
Stop if old clients can lose unsaved input, a mutation may be replayed with unknown outcome, or a serving build cannot safely interpret the action, cache entry or schema it receives.
What does this choice mean for hiring and salary evidence?
Hiring for Next.js means hiring React capability plus experience with the framework's server, route, cache and deployment boundaries. Hiring for a custom React stack can mean more responsibility for choosing and operating those layers. Neither choice implies a universal salary premium.
A job post is evidence of the requirements one employer advertised at one point in time. Compare role scope, seniority, location, employment type and listed responsibilities before treating a post as a match. A requirement for Next.js may reflect one team's architecture, not a market-wide advantage.
The linked salary panel reports the advertised minimum as an approximate annualized USD amount, based on salary-bearing posts in its selected cohort, not all jobs. Compare only that unit and sample definition. A difference between React and Next.js cohorts does not show that the framework caused a pay difference, that one skill is in greater demand, or that the roles are comparable. Use the source posts and panel definitions to interpret the evidence; do not turn correlation into a hiring forecast.
Role evidence check · Worked example
Candidate role: Senior product engineer, Berlin, full-stack ownership
Post requires: React, Next.js App Router, server-side data, cache debugging
Compare against: role scope, location, seniority, contract type and date
Salary panel: advertised minimum, approximate annualized USD; inspect salary-bearing cohort and filters
Conclusion: describe this selected sample, not all jobs or a framework premium
This is a reading aid. The site panel's unit is an approximate annualized USD advertised minimum from selected salary-bearing posts; it does not represent all jobs or establish labor-market demand.
Non-executable evidence worksheet; no salary or demand claim.
Follow-up: Can salary data tell a team which framework to adopt?
No. Salary observations can inform hiring context when the cohorts are comparable, but the product's route, data, security, cache and hosting requirements should decide the framework.
These are Hacker News job posts that mention these technologies, not employee earnings or a measure of what a skill adds to pay. The amounts summarize annualized advertised minimums in approximate USD. Groups can overlap and differ in roles, locations and dates.
Approximate USD using ECB daily reference rates as of 2026-10-30. Original currencies and offer ranges remain on the source listings. These figures cover posts tagged Next.js, rather than every job in the broader technology family.
Approximate USD using ECB daily reference rates as of 2026-10-30. Original currencies and offer ranges remain on the source listings. These figures cover posts tagged React, rather than every job in the broader technology family.
Middle-half salary ranges on one shared scale
The band runs from the 25th to 75th percentile; the vertical marker is the median. Both rows use approximate USD per year.
Next.js $140,000 median
React $150,000 median
$100,000$170,000
How many source posts appear in both salary groups?
Source posts can appear in both groups in this salary dataset. The same advertised salary can therefore contribute to both summaries.
Next.js posts in this dataset87 of 141 also tagged React · 61.7%
React posts in this dataset87 of 425 also tagged Next.js · 20.5%
What these bars count
Bars count distinct source posts with known HN IDs in these salary cohorts, not every Hacker News post or the wider job market. Duplicate IDs count once; rows without a valid HN ID are left out, so the bars cannot establish overlap for the full population. These are source-post counts, not the salary-observation counts in the cards above. A missing tag does not prove a technology was not used. Overlap does not establish employer preference, adoption or a pay effect.