Patterns
Imperative Updates
Fill fields from code: load a saved address, look up a city from a ZIP code, copy one address into another, or clear one.
What this shows
useFormContext() lets any component inside the form read and write it.
setValue(name, { value })sets one field and re-validates it, as in the ZIP code lookup.setFieldValues([...])sets several fields at once, as in the saved address and the Clear button.getValue({ name, type: 'field' })reads a field, as in Copy from billing.