Submit metadata has not yet been implemented in v2. Adding it would allow metadata associated with a submission to remain available throughout the relevant form lifecycle.
Submit metadata should be available in the following places:
- Validators: Optional, because a validator may run for an event other than submission.
- Listeners: Always optional to keep the shared listener context manageable.
onSubmit: Required. The callback should receive the effective metadata, using the per-submission override when provided and the configured default otherwise.
Some thoughts
For validators, a discriminated union with a submit event could make the metadata available with stronger type safety only when the event is a submission. Listener metadata should likely remain optional because expressing the same relationship in the shared listener types may be too cumbersome.
Submit metadata has not yet been implemented in v2. Adding it would allow metadata associated with a submission to remain available throughout the relevant form lifecycle.
Submit metadata should be available in the following places:
onSubmit: Required. The callback should receive the effective metadata, using the per-submission override when provided and the configured default otherwise.Some thoughts
For validators, a discriminated union with a submit event could make the metadata available with stronger type safety only when the event is a submission. Listener metadata should likely remain optional because expressing the same relationship in the shared listener types may be too cumbersome.