0Pricing
React Academy · Lesson

Server Actions in React 19 and Next.js

Understand how Server Actions execute on the server, close over server context, and return data to the client.

What Are Server Actions

Server Actions are async functions that execute on the server, not in the browser. They are marked with the 'use server' directive placed at the top of the file or at the top of the function body, signaling to the framework that this function must never run on the client side.

Server Context Access

Because Server Actions run on the server, they have access to the full server context: database connections, environment secrets, session data, and filesystem resources. This is fundamentally different from client components, which can only access what the browser exposes.

All lessons in this course

  1. Server Actions in React 19 and Next.js
  2. Form Actions: Replacing API Routes for Mutations
  3. useActionState and useFormStatus
  4. Progressive Enhancement with Server Actions
← Back to React Academy