Api
useFormAction
Typed form values, submission snapshots, reset, and field/root errors reference.
useFormAction
const form = useFormAction(typedReference, {
initialValues: { profile: { name: '', email: '' } },
...actionOptions,
})
| Additional option | Type | Behavior |
|---|---|---|
initialValues | Inferred action input | Required; initial values are captured and cloned |
| Additional/overridden return | Behavior |
|---|---|
values | Mutable ref of typed input values |
submit() | Snapshots current values and resolves the full ActionResult |
fieldErrors | Computed dotted-path error map; excludes _root/_errors |
rootErrors | Computed string array combining _root/_errors |
reset() | Cancels/reset action state and restores captured initial values |
Other useAction options/returns remain available, including execute/executeAsync for explicit input and cancel for request cancellation without clearing values. Use plain form values; JSON serialization still governs the server contract. Cycles/custom instances/file uploads are not supported by ordinary form snapshots. Working recipes.