You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/docs/usage/client-components/hooks/callbacks.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -9,18 +9,18 @@ Hook callbacks are a way to perform custom logic based on the current action exe
9
9
10
10
```tsx
11
11
const action =useAction(testAction, {
12
-
onExecute: (input) => {},
13
-
onSuccess: (data, input, reset) => {},
14
-
onError: (error, input, reset) => {},
15
-
onSettled: (result, input, reset) => {},
12
+
onExecute: ({ input }) => {},
13
+
onSuccess: ({ data, input, reset }) => {},
14
+
onError: ({ error, input, reset }) => {},
15
+
onSettled: ({ result, input, reset }) => {},
16
16
});
17
17
```
18
18
19
19
Here is the full list of callbacks, with their behavior explained. All of them are optional and have return type `void` or `Promise<void>` (async or non-async functions with no return):
20
20
21
21
| Name |[`HookActionStatus`](/docs/types#hookactionstatus) state | Arguments |
0 commit comments