Server Actions and Mutations

Fetching Data and Caching and Revalidation covered reads. Writes go the other way: the browser pushes. A Server Action is an async function that lives on the server and that React 7,897 calls from the browser as if it were local — no route to invent, no fetch to write, no JSON to parse — and the updated page comes back in the same response as the function's return value.

Every listing, log and screenshot below came from a Next.js 16.3.5 10,514 project on Node.js 25.8.0 2,131 with React 19.3.0 and zod 4.6.5, extending the notes app of Revalidating Tags with a session and an owner per note. React's form Hooks are Forms; this is how Next.js wires them.

One sentence governs the rest. A Server Action compiles to a public HTTP endpoint. 'use server' does not hide the function; it publishes it under an ID. Anyone who learns that ID can POST to it, with any arguments, without loading your page.

One POST carries the mutation, the action's return value and the re-rendered page
One POST carries the mutation, the action's return value and the re-rendered page

Subsections