[Types] Form onSubmit is mandatory on every package after latest release
The PR that fixed #219 inadvertently seems to have made the onSubmit prop in the Form component mandatory on every package.
Here's a repro with Solid https://stackblitz.com/edit/modular-forms-solid-phgga2?file=src%2Froutes%2Flogin.tsx
I was also able to repro on the Preact package so I guess it's the same for all (since the fix for #219 was applied everywhere)
The bug goes away when reverting to 0.22.0 instead of using the latest 0.22.1.
@fabian-hiller I know you're busy on Valibot, I'd have made a PR directly but I'm not sure how you want to tackle this since it's on every package. Is making onSubmit optional on the forms props enough? I don't know if there's a reason why it's not optional right now. In that case I'll make a PR asap.
Does a form without onSubmit make sense? How do you process the submission?
Does a form without onSubmit make sense?
This is the case for every <form> element that gets enhanced implicitly by a framework. In Next.js, Remix and Solidstart you don't use onSubmit because they work with the framework's action concept instead.
I like that modular forms does it internally (which allows progressive enhancement), but a user from the outside determines the actual behaviour of the form via the action they provide to it (in both Next.js and SolidStart).
I know #3 is sort of related to this and that's a work in progress, but still I was using modular forms without a problem until I updated to 0.22.1
I understand. I can make it optional. In general I would like to rewrite everything to make it better and offer optimized solutions for the actions feature of every framework, but at the moment I do not have time for this.
A new version is available