mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
6fd889b922
## 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.