MENU
Definitions
There are different ways to define a server function.
To designate an async function in a server component as a server action, include the 'use server' directive at the start of the function body.
You can pass a server action defined in a server component down to a client component.
The arguments and return value of Server Actions must be serializable by React.
The arguments and return value of Server Actions must be serializable by React.
All async functions exported from a file with a 'use server' directive at the top are server actions, usable in both server and client components.
We can't set an event handler in an HTML element in a server component unless the prop is a server action.
To ensure a server action is indeed running on the server, ensure that when you call console.log(), it logs to the server terminal and not on the browser developer's tools interface (F12).