| title | useAction |
|---|
useAction allows an action to be invoked programmatically.
import { useAction } from "@solidjs/router";
import { updateNameAction } from "./actions";
const updateName = useAction(updateNameAction);
const result = updateName("John Wick");:::info[Note]
useAction requires client-side JavaScript and is not progressively enhanceable.
:::
action: The action to be invoked.
useAction returns a function that invokes the action.
It shares the same signature as the action itself.