Sometimes it's better to seperate your forms, for example if:
- they deal with different concerns
- it should be possible to save them independently
- they are placed inside a wizard
In some cases you might have to connect them back together in order to submit all forms at once. As an example you could have multiple forms which can be saved independently and then also abutton, to trigger submission for all forms.
useMergedSubmit is a custom hook, that returns a function which is similar to the
handleSubmit returned by
It receives any amount of fluent form instances as paramater:
Following example contains two seperate forms: one for personal details and another for address details.
handleSubmit function returned by
useMergedSubmit can be called with with a success/failure callback and triggered via e.g. a button click: