Lifecycle
A mounted MLForm moves through a small set of events:
- Schema is normalized.
- Field state is created.
- Layout is resolved.
- Fields update as users type.
- Conditions change hidden, disabled, or read-only state.
- Validation runs.
- Submit serializes active values.
- Transport returns reports or errors.
- Report state updates.
unmount()removes listeners and DOM owned by MLForm.
Hooks let host code observe this flow without owning it. Use them for analytics, side effects, server error mapping, and cleanup coordination.
Errors belong to the stage that produced them:
| Stage | Example |
|---|---|
| schema/layout setup | duplicate field id, missing layout reference |
| field validation | required field, range error, custom validator failure |
| submit | abort, transport failure, payload limit |
| report fetch | async report failed after submit |
Keep lifecycle work close to the layer that owns it. Field behavior belongs near schema/runtime. Visual recovery belongs near kit or host UI. Network policy belongs in transport.