Skip to content

feat: FormModal default now handles async and sync submit handlers differently, and implementor can hook into those with onError and onSuccess props.

Ethan Freestone requested to merge feat/FormModal into main

feat: FormModal default now handles async and sync submit handlers differently, and implementor can hook into those with onError and onSuccess props.

onError and onSuccess function props now accepted, which will fire on error and on success.

A caught error in the submit handler will be handled as if it were a "success", so any caught errors should be rethrown

The "restart" built into the submit handler will now only fire onSuccess (either sync or async).

If the submit handler passed into FormModal contains a chained .then which does not pass on the result, that result will obviously not be available to the onSuccess hander.

Renamed footer prop from handleSubmitNoRestart to handleSubmitRaw (old prop remains in place, but is deprecated)

Merge request reports