2. Hooks
Hooks are the second way to execute Server Actions in Client Components. They are a more powerful way to handle mutations, as they enable a much more granular control over the action execution flow.
useAction
and useOptimisticAction
hooks are similar, but have different use cases. You can find all the information about them in the next sections.