Skip to content

Commit

Permalink
Add description to Direct Usage section
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamMikacich committed Sep 29, 2024
1 parent 18af44a commit 7f45a23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/website/content/docs/api/useAction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ An error's path is determined by the zod schema or optionally explicitly defined

## Direct Usage

The `useAction` hook can also be used directly with the `execute` function, allowing for more flexible control over when and how the action is triggered. This approach is useful when you need to perform additional logic or transformations before executing the action.

<Tabs items={['Greeting.tsx', 'actions.ts']}>
<Tab value="Greeting.tsx">

Expand Down Expand Up @@ -179,6 +181,8 @@ An error's path is determined by the zod schema or optionally explicitly defined
</Tab>
</Tabs>

In this example, the `execute` function is called directly when the button is clicked, passing the `name` state as an argument.

## Parameters

| Property | Type | Description |
Expand Down

0 comments on commit 7f45a23

Please sign in to comment.