View Source

Form.Watch & onFieldChange

React to field changes with side effects — auto-generate slugs, sync dependent fields, recalculate totals.

1. onFieldChange prop

Type a product name — slug is auto-generated. Change price or quantity — total recalculates.

Minimum 1 character
Minimum 1 character
Minimum 0
Minimum 1

Form Values

{5 items
"name":""
"slug":""
"price":10
"quantity":1
"total":10
}

2. Form.Watch component

Select a country — currency and greeting update automatically via a renderless watcher.

Form Values

{3 items
"country":"US"
"currency":"USD"
"greeting":"Hello!"
}