How can I dynamically compose/chain multiple 'handleSubmit' methods in React Hook Form? #9739
Unanswered
krasivyy3954
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have multiple useForm hooks in my form component. I want to create a method to dynamically handle one submit button for an arbitrary number of hooks. The idea is that the partial forms should be validated successively.
For an isolated scenario, this approach works:
Now I want to create a generic 'handleMultiple'. I tried to utilize the redux 'compose' function, but that approach just ignores the validation:
Any ideas how to archive this? Different approaches are also appreciatied.
Beta Was this translation helpful? Give feedback.
All reactions