Skip to content

Use Server

Spicy — senior dev territoryFrontend

ELI5 — The Vibe Check

'use server' is a React directive that marks a function as running on the server only. You can call it from the client like a normal function, and React handles the RPC under the hood. Server functions in disguise.

Real Talk

The 'use server' directive in React marks a module or function as a Server Function — callable from client components but executed on the server. React bundlers generate RPC proxies automatically. Used for mutations and server-side actions in Next.js App Router and other RSC-compatible frameworks. Contrasts with 'use client', which marks a Client Component.

When You'll Hear This

"Add 'use server' to the top of the mutation function." / "'use server' replaces most custom API routes."

Made with passive-aggressive love by manoga.digital. Powered by Claude.