Files
vercel__next.js/docs
Aurora Scharff 6fd889b922 docs: expand and modernize the Single-Page Applications guide (#95860)
## What

Expands the [Single-Page Applications
guide](https://nextjs.org/docs/app/guides/single-page-applications):

- Adds a full **TanStack Query** section (server prefetch + `dehydrate`
+ client read), alongside the existing SWR and `use()` + Context
patterns
- Makes this guide the **canonical home for the `use()` + Context
pattern**, so it is no longer duplicated across the docs (fetching-data
keeps only the `React.cache` reuse and links here)
- Rewrites the mutations section around one shared reducer with
`useActionState` + `useOptimistic`
- Links a companion runnable demo for every example, and modernizes the
examples (typed `PageProps`/`LayoutProps`, `useSuspenseQuery` vs
`useQuery` guidance, forms/server-actions related guides)

## Why

The guide was outdated and thin on runnable examples, had no real
TanStack Query coverage, and the context + `use()` pattern was
duplicated across several guides.

## How

Each section maps to a runnable demo route. The context pattern is
centralized here as the single source of truth, with fetching-data,
streaming, and authentication linking to it.

Docs-only.
2026-07-24 17:05:46 +02:00
..