5 ms·
> And it makes it harder to do so. I hate doing forms in React. You basically have to reinvent the plumbing that's already standard with the HTML spec. Very ted
by arvinsim 6y ago
> And it makes it harder to do so. I hate doing forms in React. You basically have to reinvent the plumbing that's already standard with the HTML spec. Very tedious.
Show me the HTML standard that supports SPA submissions that don't reload the page.
It seems that your problem is about SPAs, not React.
- krapp 6y ago>Show me the HTML standard that supports SPA submissions that don't reload the page. Any HTML form that uses a standard button element rather than a submit button. Attach a JS event listener to it, read the form, post by AJAX. That was a thing long before React came along.
- richthegeek 6y agoYou can actually do that with React. Nothing is stopping you. It's not the recommended way because as soon as you want validation or dynamic fields you need state anyway. And there're easy libraries like Formik that handle all the annoyances for you (although taking you away from raw HTML at the same time). Do you miss punch-cards too?
- krapp 6y agoOf course you can do that with React. GP implied that it was impossible without React, because standard HTML didn't support it, but wasn't correct. There may be plenty of advantages to using React but it isn't necessary for "SPA submissions that don't reload the page."
- cygx 6y agoThat was a thing even before AJAX came along, eg via forms targetting an iframe. A long time ago, I wrote a single-page chat application that continuously updated through chunked transfers, with submission via a plain old HTML form that received a 204 response.