Closed danielo515 closed 7 years ago
The problem with your original implementation is not that you don't have to call it, but that you're calling it on render by including the parentheses. By removing the parentheses, you're essentially giving onSubmit a reference to the function to call it, rather than giving it the result of the already-executed-on-render handleSubmit().
Dear @TrevorHinesley, you are totally right. I don't know what I was thinking when I wrote that piece of code. Probably I was confused about reading the documentation too late at night. However I still think that a simple example will help much more than the best of the explanations.
Regards
Hi @danielo515 Sorry for the confusion and the delay. I just updated the README to include the form definition and tweaked the wording. Hopefully this is more clear.
Dear @colinbate I can't see the difference. May you point me to the commit so I can better check it?
In case you hadn't found it, the commit was: https://github.com/colinbate/redux-form-submit-saga/commit/523ae8613cd9cd1e20e65cc4ccb0de2a21c6cf69
Much better now. Thanks a lot
Hello,
I know is kind of weird that I open an issue to prevent people like me opening issues of this kind... but life is sometimes this strange.
My problem was about the onSubmit handler. I was making sure to put the correct onSubmit function on the reduxForm factory:
But I was calling the handleSubmit on my form instead of just passing in the handle, so I was doing
<Form horizontal onSubmit={handleSubmit()}>
instead of<Form horizontal onSubmit={handleSubmit}>
. Probably a stupid error that is totally my fault, but I think it is good to make it noticeable.Probably what confused me was the following sentence:
I supposed that you should call handleSubmit without parameters, but you don't have to call it at all.
Regards