TanStack Start 1.0 vs Next.js 16: The Same Page Built in Both
TanStack Start hit 1.0 a week after Next.js 16.4 went all in on the server. One page built in both, where they differ, and which to pick.
CarnielOn this page17 sections
Two weeks in October summed up where React frameworks are heading.
On October 6, Next.js 16.4 made Cache Components the default for new apps, doubling down on React Server Components and a server-first model (Next.js blog). A week later, on October 13, TanStack Start reached 1.0. Its creator, Tanner Linsley, describes it as a client-first alternative, built for developers who feel the React world has leaned too far toward the server (TanStack blog).
Both can render on the server. Both can run code that never ships to the browser. The difference is which side each one treats as home.
Reading feature lists only tells you so much, so here's the same small page built in both, followed by where they really differ and how to choose.
The difference in one sentence
In Next.js, your code runs on the server unless you say otherwise. In TanStack Start, your code runs everywhere unless you say otherwise.
Next.js components are Server Components by default. You opt into the browser with 'use client'. TanStack Start components are normal React components that render on the server for the first load and then run in the browser. You opt into server-only code by wrapping it in a server function.
Almost every other difference comes from that one choice.
What we're building
A product page for a small Lagos fashion store. It lists products from the database, and each product has a Like button that updates the count. That's enough to cover the basics of any app: reading data on the server, writing data, and refreshing the page afterwards.
In both versions, db is a Prisma client. Both were built and run against Next.js 16.4.5 and TanStack Start 1.169.4, and the Like button worked in each.
The Next.js version
Three files. First, a cached function that reads products:
// app/products/data.ts
import { cacheLife, cacheTag } from 'next/cache'
import { db } from '@/lib/db'
export async function getProducts() {
'use cache'
cacheLife('minutes')
cacheTag('products')
return db.product.findMany({ orderBy: { createdAt: 'desc' } })
}Then a Server Action that records the like and clears the cache tag:
// app/products/actions.ts
'use server'
import { updateTag } from 'next/cache'
import { db } from '@/lib/db'
export async function likeProduct(id: string) {
await db.product.update({
where: { id },
data: { likes: { increment: 1 } },
})
updateTag('products')
}And the page, which is a Server Component:
// app/products/page.tsx
import { getProducts } from './data'
import { likeProduct } from './actions'
export default async function ProductsPage() {
const products = await getProducts()
return (
<ul>
{products.map((p) => (
<li key={p.id}>
{p.name}: ₦{p.price.toLocaleString()} ({p.likes} likes)
<form action={likeProduct.bind(null, p.id)}>
<button>Like</button>
</form>
</li>
))}
</ul>
)
}Notice what's missing: there's no client component. The form posts straight to the Server Action, and updateTag makes Next.js refresh the cached list. With cacheComponents: true in the config, the build marks the page as static and prerenders it, with the cache refreshing every minute:
Route (app) Revalidate Expire
└ ○ /products 1m 1h
○ (Static) prerendered as static contentIf use cache, cacheLife and updateTag are new to you, I explain each one in my guide to caching in Next.js 16.
The TanStack Start version
Two files. The server functions:
// src/server/products.ts
import { createServerFn } from '@tanstack/react-start'
import { db } from '#/lib/db'
export const getProducts = createServerFn().handler(async () => {
return db.product.findMany({ orderBy: { createdAt: 'desc' } })
})
export const likeProduct = createServerFn({ method: 'POST' })
.validator((data: { id: string }) => data)
.handler(async ({ data }) => {
await db.product.update({
where: { id: data.id },
data: { likes: { increment: 1 } },
})
})And the route:
// src/routes/products.tsx
import { createFileRoute, useRouter } from '@tanstack/react-router'
import { getProducts, likeProduct } from '#/server/products'
export const Route = createFileRoute('/products')({
loader: () => getProducts(),
component: Products,
})
function Products() {
const products = Route.useLoaderData()
const router = useRouter()
async function like(id: string) {
await likeProduct({ data: { id } })
router.invalidate() // re-runs the loader
}
return (
<ul>
{products.map((p) => (
<li key={p.id}>
{p.name}: ₦{p.price.toLocaleString()} ({p.likes} likes)
<button onClick={() => like(p.id)}>Like</button>
</li>
))}
</ul>
)
}Here's what's going on:
createServerFnmarks code that only runs on the server. At build time, TanStack Start turns each one into an endpoint and replaces the browser copy with a fetch call. Your database code never ships to the client.The
loaderruns on the server for the first page load, so the HTML arrives with products already in it. On later client-side navigations, it runs in the browser and callsgetProductsover the network..validator()checks the input before your handler runs. You can pass a plain function like this, or a Zod schema.router.invalidate()re-runs the loader after the like, so the count updates.Route.useLoaderData()is fully typed. Hover overproductsin your editor and you'll see the exact shape returned by the server function, with no manual types.
The Like button is a normal onClick handler, because every component here is a client component that also renders on the server. No directives anywhere.
Where they really differ
Caching
This is the biggest gap. Next.js has a whole caching system built in: use cache, cacheLife, tags, prerendering, and partial prefetching. Our product page became a static page without any extra work.
TanStack Start has no server cache layer of its own. The router does cache loader results in the browser. You can set staleTime on a route so it doesn't refetch on every visit, but the default is 0, meaning data is considered stale straight away. For anything more, you use TanStack Query, a CDN, or your own cache. That's more work, but there's also less magic to learn and debug.
Choosing what renders on the server
TanStack Start lets each route decide how much happens on the server with one option (docs):
export const Route = createFileRoute('/dashboard')({
ssr: 'data-only', // run the loader on the server, render the component in the browser
loader: () => getDashboard(),
component: Dashboard,
})true (the default) renders everything on the server. false skips the server and does it all in the browser, which is handy for pages that use chart libraries or anything that touches window. 'data-only' sits in between.
In Next.js you get the same results by combining Server Components, Client Components and Suspense. It's more flexible at the component level, but it's harder to look at a page and know what runs where.
Type safety
TanStack Start is built on TanStack Router, and type safety is its strongest point. Route params, search params and links are all checked by TypeScript. Link to a route that doesn't exist, or forget a required param, and your editor tells you before you run anything. Search params can be validated with a schema, so ?page=abc never reaches your component as a string when you expected a number.
Next.js has typed routes too, but search params are still mostly strings you parse yourself.
React Server Components
In Next.js, Server Components are the foundation. In TanStack Start, they're optional. Start 1.0 supports them as an add-on, but Linsley says he stopped using them on tanstack.com because it became harder to understand what was being shipped to the browser (TanStack blog).
Whichever side you're on, it's an honest point. The Server Components model can be powerful, but it's also the part of React that developers find hardest to reason about.
Build tools and hosting
Next.js uses Turbopack and works best on Vercel, though it runs fine on your own server. TanStack Start uses Vite for building and Nitro for the server, which means it can deploy to Vercel, Netlify, Cloudflare, Railway, Render or a plain Node server. The CLI's --deployment flag sets one up for you when you create the project.
If your team already uses Vite for other projects, Start will feel familiar right away.
Security
This is a fair question after the month Next.js has had. Its October security release included a critical bug in use cache that let attackers run code on the server (Next.js blog). I wrote up how to make sure your app is patched in a separate post.
That doesn't make TanStack Start automatically safer. Every framework that runs code on a server will have security bugs. What changes is the shape of the risk. Start's server functions are plain endpoints with built-in CSRF protection, which is easier to reason about. But you still have to protect each one. The docs are clear that beforeLoad, which many people use for auth redirects, is not a security boundary (docs). Any server function that reads or writes private data needs its own auth check or auth middleware.
Ecosystem and jobs
Next.js is much bigger. More tutorials, more libraries tested against it, more answers when you get stuck, and many more job posts asking for it. TanStack itself is huge (TanStack Query is in a lot of React apps), but Start as a full framework is only weeks past 1.0.
How much JavaScript each one sends
For readers on mobile data, page weight matters. On a first load of the products page, the Next.js version transferred about 137 KB and the TanStack Start version about 112 KB, compressed, including HTML and CSS.
For a page this small, that's close enough to call a draw. The bigger savings will always come from what you add to a page, not the framework underneath. If you want to measure what your own site costs your users, I wrote about what a website costs to open in Lagos.
When to pick which
Pick Next.js if
Your site is mostly content: blogs, marketing pages, docs, online stores. Built-in caching and prerendering do a lot of work for you.
You want one obvious way to do things, with the biggest community behind it.
You deploy on Vercel, or you're hiring and want the widest pool of developers who already know the framework.
You're comfortable with Server Components, or want to learn them properly.
Pick TanStack Start if
You're building an app more than a site: dashboards, admin panels, internal tools, anything where users spend a long time clicking around after the first load.
You already use TanStack Query and TanStack Router and like how they work.
You want clear lines between server and client code, without directives deciding it for you.
You want to use Vite and keep your hosting options open.
If you have an existing Next.js app that works, there's no reason to rewrite it. This is a decision for your next project, not your current one.
Try it in five minutes
Create a TanStack Start app with the official CLI. It asks for your package manager and optional add-ons like Tailwind and ESLint:
npx @tanstack/cli@latest createThen copy the two files above into src/server/products.ts and src/routes/products.tsx, swap in your own data, run npm run dev and open /products. The router picks up the new route file automatically.
The best way to know which model suits you is to build the same small thing in both, like we did here. You'll know within an hour which one your brain prefers.