-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to programatically submit a <Form> component #1348
Comments
Manually call the method that you'd otherwise pass to the PRs welcome :) |
Also, unless it's explicitly documented, you should avoid using internal methods of the form (or any other) component. This is because doing so means reaching through what should be an opaque abstraction into internal methods that may change at any time. So, unless these methods become a formal part of the public API, it's likely best to follow @levithomason 's advice. Furthermore, it's generally bad practice to reach downward through the React tree in order to initiate side effects. |
FWIW, I actually plan to remove the onSubmit handler as it has caused lots of confusion and encouraged bad practice. The current implementation is DOM based anyhow, which just makes it this much worse. |
Please add documentation on how to programatically submit a
component.I guess it's about adding a ref and calling submit on it or is there another option?
The text was updated successfully, but these errors were encountered: