FormField
Wraps a form atom with validation rules, managing dirty/touched/error state and injecting the resolved error string via cloneElement.
Example
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | string | — | No | Field name — registers with parent Form when provided |
rules | ValidationRule[] | — | No | Array of validation rules (required, minLength, maxLength, pattern, custom) |
validateOn | 'blur' | 'change' | 'submit' | — | No | When to run validation (default: blur) |
children | ReactElement | — | Required | A single form atom (Input, Textarea, Select, Checkbox, RadioGroup) |