Use when building forms, handling form submission, implementing form validation, or using React 19 form actions. Prevents the common mistake of mixing controlled and uncontrolled patterns or missing form accessibility. Covers controlled vs uncontrolled inputs, React 19 form actions, useFormStatus, useActionState, useOptimistic, file inputs, validation patterns. Keywords: form, controlled, uncontrolled, useFormStatus, useActionState, action, file upload, form validation, React Hook Form, Formik, Zod, form submit, input handling..
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
react-syntax-forms
description
Use when building forms, handling form submission, implementing form validation, or using React 19 form actions. Prevents the common mistake of mixing controlled and uncontrolled patterns or missing form accessibility. Covers controlled vs uncontrolled inputs, React 19 form actions, useFormStatus, useActionState, useOptimistic, file inputs, validation patterns. Keywords: form, controlled, uncontrolled, useFormStatus, useActionState, action, file upload, form validation, React Hook Form, Formik, Zod, form submit, input handling..
license
MIT
compatibility
Designed for Claude Code. Requires React 18.x or 19.x with TypeScript.
File inputs, third-party integrations, simple forms
Form actions
19+
FormData (<form action={fn}>)
Async submissions, progressive enhancement, Server Functions
Input Type Quick Reference
Input Type
Controlled Prop
Event Value Access
TypeScript Type
text
value
e.target.value
string
number
value
Number(e.target.value)
number
checkbox
checked
e.target.checked
boolean
radio
checked
e.target.value
string
select
value
e.target.value
string
textarea
value
e.target.value
string
file
ALWAYS uncontrolled
e.target.files
FileList | null
Critical Warnings
NEVER mix value and defaultValue on the same element. Choose controlled OR uncontrolled.
NEVER set value on a file input. File inputs are ALWAYS uncontrolled because their value is read-only for security reasons.
NEVER call useFormStatus in the same component that renders <form>. It MUST be called from a child component rendered inside the <form>.
NEVER use the deprecated useFormState from react-dom. ALWAYS use useActionState from react instead.
ALWAYS call e.preventDefault() in onSubmit handlers (React 18 pattern). Form actions (React 19) handle this automatically.
Decision Tree: Which Form Approach?
Need real-time validation or formatted input?
YES --> Controlled inputs (value + onChange)
NO -->
Using React 19 with async submission?
YES --> Form actions (<form action={fn}>)
NO -->
Need file upload or third-party widget?
YES --> Uncontrolled inputs (defaultValue + ref)
NO -->
Simple form with few fields?
YES --> Uncontrolled inputs
NO --> Controlled inputs
When to Use Each
Use Case
Approach
Why
Search-as-you-type
Controlled
Need value on every keystroke
Credit card formatting
Controlled
Must transform input in real time
File upload
Uncontrolled
File inputs cannot be controlled
Server action form
Form actions (React 19)
Built-in pending state, progressive enhancement
Simple contact form
Uncontrolled or form actions
No per-keystroke logic needed
Multi-step wizard
Controlled
Must track and validate across steps
Controlled Inputs
React state is the single source of truth. Every keystroke triggers a re-render.