useAction
Edit this pageuseAction 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");note
useAction requires client-side JavaScript and is not progressively enhanceable.
Parameters
action: The action to be invoked.
Returns
useAction returns a function that invokes the action.
It shares the same signature as the action itself.