Agent skill
tracking-form-status
Teaches useFormStatus hook for tracking form submission state in React 19. Use when implementing submit buttons, form loading states, or pending indicators.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/tracking-form-status
SKILL.md
Form Status Tracking with useFormStatus
useFormStatus provides status info about parent form submissions.
Basic Usage
MUST be called inside a form component:
import { useFormStatus } from 'react-dom';
function SubmitButton() {
const { pending, data, method, action } = useFormStatus();
return (
<button type="submit" disabled={pending}>
{pending ? 'Submitting...' : 'Submit'}
</button>
);
}
function MyForm() {
async function handleSubmit(formData) {
'use server';
await saveData(formData);
}
return (
<form action={handleSubmit}>
<input name="email" />
<SubmitButton />
</form>
);
}
Return Values
pending(boolean): Whether form is submittingdata(FormData | null): Data being submittedmethod(string): HTTP method ('get' or 'post')action(function | null): Action function
Critical Requirement
❌ Wrong - called at form level:
function MyForm() {
const { pending } = useFormStatus();
return <form>...</form>;
}
✅ Correct - called inside form:
function MyForm() {
return (
<form>
<SubmitButton />
</form>
);
}
function SubmitButton() {
const { pending } = useFormStatus();
return <button disabled={pending}>Submit</button>;
}
For comprehensive useFormStatus documentation, see: research/react-19-comprehensive.md lines 312-355.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?