Last thrown error, normalized to the public ActionExecuteError shape, or null.
Trigger the action with the given parameters. Returns the response body
on success AND throws on failure — the same error is stored in error
for render-time consumers. Resolves to the discriminated result shape
(see ActionResultForKind<TKind>); when TKind is omitted it resolves
to AnyActionResult, narrowable via "<key>" in r.
Resolves to null (without making a request) when actionId is null
or the SDK is not yet initialized — guard the host-side caller with
if (!actionId) return; if these cases are reachable.
Clear result and error.
Last response, or null before first call and after reset().
Triggers a pre-existing Metabase action. The first arg is the action's numeric id or its
entity_idstring; supplyTParametersas the first generic to type theexecuteargument, and optionallyTKindas the second generic to type the discriminatedresultshape.Without
TKind,resultdefaults to a union of every possible response body (AnyActionResult) — authors who don't know the kind upfront can narrow with"<key>" in resultinstead of casting fromRecord<string, unknown>.useAction<{ name: string; email: string }, "create">(42);
Unlike the query hooks, this does NOT run on mount — the caller invokes
executeexplicitly from an event handler. To gate execution conditionally, branch in the event handler (e.g.if (!user.canEdit) return;) before callingexecute.