Loading
A function that runs on the server when a user submits a form or clicks a button — like dropping a letter in a mailbox that goes straight to the post office.
An async function marked with 'use server' that executes on the server when called from the client. Server Actions enable form submissions and data mutations without creating separate API endpoints, and they work without JavaScript via progressive enhancement.
Server Actions are compiled into POST endpoint closures referenced by action IDs. The React Flight protocol serializes arguments and return values. Actions integrate with React's transition system, enabling useOptimistic and useActionState for optimistic UI. They can be composed into form actions (formAction prop) that work without client JS, satisfying progressive enhancement. Revalidation (revalidatePath/revalidateTag) triggers cache invalidation after mutations.