---
name: "react-19-use-action-state"
description: "Manage asynchronous form submissions, pending spinners, and error state via useActionState."
metadata:
  author: "React"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "use react 19 useactionstate"
  - "track ispending form react 19"
  - "manage server action errors"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# React 19 useActionState Form Transitions & Pending States

Replaces legacy useFormState with React 19 useActionState: tracking form state, isPending boolean, composing with native HTML form action attributes, and managing reset workflows.

## When to Invoke
Invoke this skill whenever you need to:
- use react 19 useactionstate
- track ispending form react 19
- manage server action errors

## Execution SOP & Rules
1. Import useActionState from 'react': const [state, formAction, isPending] = useActionState(actionFn, initialState).
2. Pass formAction directly to <form action={formAction}>.
3. Use isPending directly in the parent component to disable submit buttons without needing separate child components.
4. Initialize with safe default state: { errors: null, data: null, message: '' }.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
