You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way to do a native post request to the server using the Form component. It would be cool to have all the state management and validation that comes with the Form with a native post at the end of it.
Proposal
Allow the onSubmit prop to take a string of 'post' | 'put' | 'patch' along with the callback function that you can pass in now. If a string is passed in, then the method attribute on the form will be populated.
Then when the form is submitted it will be validated and then only when valid the form will be submitted.
We should probably also add a new prop for the action that allows us to submit the form to a different URL
Problem to solve
There is no way to do a native post request to the server using the
Form
component. It would be cool to have all the state management and validation that comes with theForm
with a native post at the end of it.Proposal
Allow the
onSubmit
prop to take a string of'post' | 'put' | 'patch'
along with the callback function that you can pass in now. If a string is passed in, then themethod
attribute on the form will be populated.Then when the form is submitted it will be validated and then only when valid the form will be submitted.
We should probably also add a new prop for the
action
that allows us to submit the form to a different URLLinks / References
The text was updated successfully, but these errors were encountered: