new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Next.js · API reference · all subjects

directives: use server

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Server Function definition with 'use server' directive

A Server Function is defined by using the 'use server' directive at the top of an asynchronous function to mark it as a Server Function, or at the top of a separate file to mark all exports of that file as Server Functions.

Inline Server Functions in Server Components

Server Functions can be inlined in Server Components by adding the 'use server' directive to the top of the function body.

Cannot define Server Functions in Client Components

It is not possible to define Server Functions directly in Client Components. However, you can invoke them in Client Components by importing them from a file that has the 'use server' directive at the top.

Server Actions with startTransition

By convention, a Server Action is an async function used with startTransition. This happens automatically when the function is passed to a form using the action prop or passed to a button using the formAction prop.

Give your agent this brain